The printer may format any part, or the whole, of the input date-time object. Typically, a complete format 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 resolve the parsed values to create the desired 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. @implSpec 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 format that occurs. The context must not be stored in an instance variable or shared with any other threads.
|
|
|
|
|
|