Strategy for printing/parsing date-time information.
The printer may print any part, or the whole, of the input date-time object. Typically, a complete print is constructed from a number of smaller units, each outputting a single field.
The parser may parse any piece of text from the input, storing the result in the context. Typically, each individual parser will just parse one field, such as the day-of-month, storing the value in the context. Once the parse is complete, the caller will then convert the context to a {@link DateTimeBuilder} to merge the parsed values to create thedesired object, such as a {@code LocalDate}.
The parse position will be updated during the parse. Parsing will start at the specified index and the return value specifies the new parse position for the next parser. If an error occurs, the returned index will be negative and will have the error position encoded using the complement operator.
Specification for implementors
This interface must be implemented with care to ensure other classes operate correctly. All implementations that can be instantiated must be final, immutable and thread-safe.
The context is not a thread-safe object and a new instance will be created for each print that occurs. The context must not be stored in an instance variable or shared with any other threads.