Annotation Interface FormattableElement


@Documented @Target({FIELD,METHOD}) @Retention(RUNTIME) public @interface FormattableElement

This Annotation can be used to document all chronological elements which allow formatted representations.

Usage note: Usually only element constants with the modifiers static und final are target of this Annotation. The target type ElementType.METHOD is only permitted if elements are generated in a ChronoExtension.

Author:
Meno Hochschild
See Also:
ChronoElement, ChronoExtension
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Returns the associated format pattern symbol in the standard format context.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Returns the alternative format pattern symbol.
    boolean
    Defines a dynamic pattern symbol.
  • Element Details

    • format

      String format

      Returns the associated format pattern symbol in the standard format context.

      Format pattern symbols should be unique among all registered elements of a given chronology. In standard elements they correspond to the format symbols defined by unicode organization in CLDR. The symbol is case-sensitive.

      Returns:
      char
      See Also:
      OutputContext.FORMAT
    • alt

      String alt

      Returns the alternative format pattern symbol.

      Almost equivalent to format() with the difference that the element shall be formatted in a stand-alone context in CLDR (for example nominative form "x January" instead of the ordinal form "x-th January"). However, the stand-alone context is not relevant for English - as "January" is still the same word, only relevant for some languages which make an explicit grammar difference.

      When used in dynamic pattern style, this alternative usually denotes the small letter for numeric formatting - in contrast to the standard big letter which also allows for textual formatting.

      The default value of an empty string just means that the stand-alone context should use the same value as in the format context.

      Returns:
      char
      See Also:
      OutputContext.STANDALONE
      Default:
      ""
    • dynamic

      boolean dynamic

      Defines a dynamic pattern symbol.

      Dynamic pattern symbols are not handled by CLDR but are resolved by a dynamic element search.

      Returns:
      boolean (default value is false)
      Since:
      5.3
      See Also:
      PatternType.DYNAMIC
      Default:
      false