Class DateTimeFormatterProviderImpl
java.lang.Object
java.util.spi.LocaleServiceProvider
javax.time.calendar.format.DateTimeFormatterProvider
javax.time.calendar.format.DateTimeFormatterProviderImpl
The Service Provider Implementation to obtain date-time formatters.
DateTimeFormatterProviderImpl is thread-safe.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ConcurrentMap<String, Object> Cache of formatters. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate intConverts the enum style to the old format style.Locale[]getFormatter(DateTimeFormatterBuilder.FormatStyle dateStyle, DateTimeFormatterBuilder.FormatStyle timeStyle, Locale locale, Chronology chronology) Gets a localized date, time or date-time format.Methods inherited from class LocaleServiceProvider
isSupportedLocale
-
Field Details
-
FORMATTER_CACHE
Cache of formatters.
-
-
Constructor Details
-
DateTimeFormatterProviderImpl
DateTimeFormatterProviderImpl()
-
-
Method Details
-
getAvailableLocales
- Specified by:
getAvailableLocalesin classLocaleServiceProvider
-
getFormatter
public DateTimeFormatter getFormatter(DateTimeFormatterBuilder.FormatStyle dateStyle, DateTimeFormatterBuilder.FormatStyle timeStyle, Locale locale, Chronology chronology) Gets a localized date, time or date-time format.- Specified by:
getFormatterin classDateTimeFormatterProvider- Parameters:
dateStyle- the date formatter style to obtain, null to obtain a time formattertimeStyle- the time formatter style to obtain, null to obtain a date formatterlocale- the locale to use, not nullchronology- the chronology to use, not null- Returns:
- the date-time formatter, never null
-
convertStyle
Converts the enum style to the old format style.- Parameters:
style- the enum style, not null- Returns:
- the int style
-