Package org.threeten.bp.format
Class DateTimeFormatterBuilder.LocalizedPrinterParser
java.lang.Object
org.threeten.bp.format.DateTimeFormatterBuilder.LocalizedPrinterParser
- All Implemented Interfaces:
DateTimeFormatterBuilder.DateTimePrinterParser
- Enclosing class:
- DateTimeFormatterBuilder
static final class DateTimeFormatterBuilder.LocalizedPrinterParser
extends Object
implements DateTimeFormatterBuilder.DateTimePrinterParser
Prints or parses a localized pattern.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLocalizedPrinterParser(FormatStyle dateStyle, FormatStyle timeStyle) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprivate DateTimeFormatterformatter(Locale locale, Chronology chrono) Gets the formatter to use.intparse(DateTimeParseContext context, CharSequence text, int position) Parses text into date-time information.booleanprint(DateTimePrintContext context, StringBuilder buf) Prints the date-time object to the buffer.toString()
-
Field Details
-
dateStyle
-
timeStyle
-
-
Constructor Details
-
LocalizedPrinterParser
LocalizedPrinterParser(FormatStyle dateStyle, FormatStyle timeStyle) Constructor.- Parameters:
dateStyle- the date style to use, may be nulltimeStyle- the time style to use, may be null
-
-
Method Details
-
print
Description copied from interface:DateTimeFormatterBuilder.DateTimePrinterParserPrints the date-time object to the buffer.The context holds information to use during the print. It also contains the date-time information to be printed.
The buffer must not be mutated beyond the content controlled by the implementation.
- Specified by:
printin interfaceDateTimeFormatterBuilder.DateTimePrinterParser- Parameters:
context- the context to print using, not nullbuf- the buffer to append to, not null- Returns:
- false if unable to query the value from the date-time, true otherwise
-
parse
Description copied from interface:DateTimeFormatterBuilder.DateTimePrinterParserParses text into date-time information.The context holds information to use during the parse. It is also used to store the parsed date-time information.
- Specified by:
parsein interfaceDateTimeFormatterBuilder.DateTimePrinterParser- Parameters:
context- the context to use and parse into, not nulltext- the input text to parse, not nullposition- the position to start parsing at, from 0 to the text length- Returns:
- the new parse position, where negative means an error with the error position encoded using the complement ~ operator
-
formatter
Gets the formatter to use.- Parameters:
locale- the locale to use, not null- Returns:
- the formatter, not null
- Throws:
IllegalArgumentException- if the formatter cannot be found
-
toString
-