Package javax.time.calendar.format
Class DateTimeFormatterProvider
- java.lang.Object
-
- java.util.spi.LocaleServiceProvider
-
- javax.time.calendar.format.DateTimeFormatterProvider
-
public abstract class DateTimeFormatterProvider extends LocaleServiceProvider
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.
- Author:
- Stephen Colebourne
-
-
Constructor Summary
Constructors Constructor Description DateTimeFormatterProvider()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract 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
-
-
-
-
Method Detail
-
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
-
-