Package javax.time.calendar.format
Class DateTimeFormatterProviderImpl
- java.lang.Object
-
- java.util.spi.LocaleServiceProvider
-
- javax.time.calendar.format.DateTimeFormatterProvider
-
- javax.time.calendar.format.DateTimeFormatterProviderImpl
-
class DateTimeFormatterProviderImpl extends DateTimeFormatterProvider
The Service Provider Implementation to obtain date-time formatters.DateTimeFormatterProviderImpl is thread-safe.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object>FORMATTER_CACHECache of formatters.
-
Constructor Summary
Constructors Constructor Description DateTimeFormatterProviderImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private intconvertStyle(DateTimeFormatterBuilder.FormatStyle style)Converts the enum style to the old format style.java.util.Locale[]getAvailableLocales()DateTimeFormattergetFormatter(DateTimeFormatterBuilder.FormatStyle dateStyle, DateTimeFormatterBuilder.FormatStyle timeStyle, java.util.Locale locale, Chronology chronology)Gets a localized date, time or date-time format.
-
-
-
Method Detail
-
getAvailableLocales
public java.util.Locale[] getAvailableLocales()
- Specified by:
getAvailableLocalesin classjava.util.spi.LocaleServiceProvider
-
getFormatter
public DateTimeFormatter getFormatter(DateTimeFormatterBuilder.FormatStyle dateStyle, DateTimeFormatterBuilder.FormatStyle timeStyle, java.util.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
private int convertStyle(DateTimeFormatterBuilder.FormatStyle style)
Converts the enum style to the old format style.- Parameters:
style- the enum style, not null- Returns:
- the int style
-
-