public abstract class DateFormatProvider extends java.util.spi.LocaleServiceProvider
DateFormatProvider provides localized
instances of DateFormat.| Modifier | Constructor and Description |
|---|---|
protected |
DateFormatProvider()
Constructs a new
DateFormatProvider. |
| Modifier and Type | Method and Description |
|---|---|
abstract java.text.DateFormat |
getDateInstance(int style,
java.util.Locale locale)
Returns a
DateFormat instance
for formatting dates with the given style in the specified
Locale. |
abstract java.text.DateFormat |
getDateTimeInstance(int dateStyle,
int timeStyle,
java.util.Locale locale)
Returns a
DateFormat instance
for formatting dates and times with the given style in the
specified Locale. |
abstract java.text.DateFormat |
getTimeInstance(int style,
java.util.Locale locale)
Returns a
DateFormat instance
for formatting times with the given style in the specified
Locale. |
protected DateFormatProvider()
DateFormatProvider.
Provided for implicit invocation by subclasses.public abstract java.text.DateFormat getDateInstance(int style, java.util.Locale locale)
DateFormat instance
for formatting dates with the given style in the specified
Locale.style - the formatting style; one of DateFormat.SHORT,
DateFormat.MEDIUM, DateFormat.LONG
or DateFormat.FULL.locale - the desired locale.java.lang.NullPointerException - if the locale is null.java.lang.IllegalArgumentException - if the style is invalid or
the locale is not one
returned by
LocaleServiceProvider.getAvailableLocales()DateFormat.getDateInstance(int,java.util.Locale)public abstract java.text.DateFormat getDateTimeInstance(int dateStyle, int timeStyle, java.util.Locale locale)
DateFormat instance
for formatting dates and times with the given style in the
specified Locale.dateStyle - the date formatting style; one of
DateFormat.SHORT, DateFormat.MEDIUM,
DateFormat.LONG or DateFormat.FULL.timeStyle - the time formatting style; one of
DateFormat.SHORT, DateFormat.MEDIUM,
DateFormat.LONG or DateFormat.FULL.locale - the desired locale.java.lang.NullPointerException - if the locale is null.java.lang.IllegalArgumentException - if either style is invalid or
the locale is not one
returned by
LocaleServiceProvider.getAvailableLocales()java.text.DateFormat#getDateInstance(java.util.Locale)public abstract java.text.DateFormat getTimeInstance(int style, java.util.Locale locale)
DateFormat instance
for formatting times with the given style in the specified
Locale.style - the formatting style; one of DateFormat.SHORT,
DateFormat.MEDIUM, DateFormat.LONG
or DateFormat.FULL.locale - the desired locale.java.lang.NullPointerException - if the locale is null.java.lang.IllegalArgumentException - if the style is invalid or
the locale is not one
returned by
LocaleServiceProvider.getAvailableLocales()DateFormat.getTimeInstance(int,java.util.Locale)