Package org.threeten.bp.format
Class SimpleDateTimeFormatStyleProvider
java.lang.Object
org.threeten.bp.format.DateTimeFormatStyleProvider
org.threeten.bp.format.SimpleDateTimeFormatStyleProvider
The Service Provider Implementation to obtain date-time formatters for a style.
This implementation is based on extraction of data from a SimpleDateFormat.
Specification for implementors
This class is immutable and thread-safe.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ConcurrentMap<String,Object> Cache of formatters. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate intconvertStyle(FormatStyle style) Converts the enum style to the old format style.Locale[]Gets the available locales.getFormatter(FormatStyle dateStyle, FormatStyle timeStyle, Chronology chrono, Locale locale) Gets a localized date, time or date-time formatter.Methods inherited from class org.threeten.bp.format.DateTimeFormatStyleProvider
getInstance
-
Field Details
-
FORMATTER_CACHE
Cache of formatters.
-
-
Constructor Details
-
SimpleDateTimeFormatStyleProvider
SimpleDateTimeFormatStyleProvider()
-
-
Method Details
-
getAvailableLocales
Description copied from class:DateTimeFormatStyleProviderGets the available locales.- Overrides:
getAvailableLocalesin classDateTimeFormatStyleProvider- Returns:
- the locales
-
getFormatter
public DateTimeFormatter getFormatter(FormatStyle dateStyle, FormatStyle timeStyle, Chronology chrono, Locale locale) Description copied from class:DateTimeFormatStyleProviderGets a localized date, time or date-time formatter.The formatter will be the most appropriate to use for the date and time style in the locale. For example, some locales will use the month name while others will use the number.
- Specified by:
getFormatterin classDateTimeFormatStyleProvider- 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 formatterchrono- the chronology to use, not nulllocale- the locale to use, not null- Returns:
- the date-time formatter, not null
-
convertStyle
Converts the enum style to the old format style.- Parameters:
style- the enum style, not null- Returns:
- the int style
-