Package javax.time.calendar.format
Class DateTimeFormatterProvider
java.lang.Object
java.util.spi.LocaleServiceProvider
javax.time.calendar.format.DateTimeFormatterProvider
- Direct Known Subclasses:
DateTimeFormatterProviderImpl
The Service Provider Interface (SPI) to be implemented by classes providing
date-time formatting information.
DateTimeFormatterProvider is an abstract class and must be implemented with care. Implementations must be thread-safe. It is strongly recommended that implementations cache the returned formatters.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract DateTimeFormatter
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
getAvailableLocales, isSupportedLocale
-
Constructor Details
-
DateTimeFormatterProvider
public DateTimeFormatterProvider()
-
-
Method Details
-
getFormatter
public abstract DateTimeFormatter getFormatter(DateTimeFormatterBuilder.FormatStyle dateStyle, DateTimeFormatterBuilder.FormatStyle timeStyle, Locale locale, Chronology chronology) Gets a localized date, time or date-time format.- 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
- Throws:
IllegalArgumentException
- if both format styles are nullIllegalArgumentException
- if the locale is not a recognized locale
-