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_CACHE
Cache of formatters.
-
Constructor Summary
Constructors Constructor Description DateTimeFormatterProviderImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private int
convertStyle(DateTimeFormatterBuilder.FormatStyle style)
Converts the enum style to the old format style.java.util.Locale[]
getAvailableLocales()
DateTimeFormatter
getFormatter(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:
getAvailableLocales
in 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:
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
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
-
-