Builder to create formatters for calendricals.
All date-time formatters are created ultimately using this builder. Each consists of two halves a {@link DateTimePrinter printer} and a {@link DateTimeParser parser}. Most of the methods will create both a printer and a parser automatically, however it is possible to create a formatter that only prints or only parses.
The basic elements of calendricals can all be added:
- Value - a numeric value
- Fraction - a fractional value including the decimal place. Always use this when outputting fractions to ensure that the fraction is parsed correctly
- Text - the textual equivalent for the value
- OffsetId/Offset - the {@link ZoneOffset zone offset}
- ZoneId - the {@link TimeZone time zone} id
- ZoneText - the name of the time zone
- Literal - a text literal
- Nested and Optional - formats can be nested or made optional
- Other - the printer and parser interfaces can be used to add user supplied formatting
In addition, any of the elements may be decorated by padding, either with spaces or any other character.
Finally, a shorthand pattern, mostly compatible with {@code SimpleDateFormat}can be used, see {@link #appendPattern(String)}. In practice, this simply parses the pattern and calls other methods on the builder.
@author Stephen Colebourne