Package javax.time.calendar.format
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 int
Converts 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 java.util.spi.LocaleServiceProvider
isSupportedLocale
-
Field Details
-
FORMATTER_CACHE
Cache of formatters.
-
-
Constructor Details
-
DateTimeFormatterProviderImpl
DateTimeFormatterProviderImpl()
-
-
Method Details
-
getAvailableLocales
- Specified by:
getAvailableLocales
in 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:
getFormatter
in 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
-