public abstract class DateFormatProvider extends LocaleServiceProvider
DateFormatProvider
provides localized
instances of DateFormat
.Modifier | Constructor and Description |
---|---|
protected |
DateFormatProvider()
Constructs a new
DateFormatProvider . |
Modifier and Type | Method and Description |
---|---|
abstract DateFormat |
getDateInstance(int style,
Locale locale)
Returns a
DateFormat instance
for formatting dates with the given style in the specified
Locale . |
abstract DateFormat |
getDateTimeInstance(int dateStyle,
int timeStyle,
Locale locale)
Returns a
DateFormat instance
for formatting dates and times with the given style in the
specified Locale . |
abstract DateFormat |
getTimeInstance(int style,
Locale locale)
Returns a
DateFormat instance
for formatting times with the given style in the specified
Locale . |
getAvailableLocales
protected DateFormatProvider()
DateFormatProvider
.
Provided for implicit invocation by subclasses.public abstract DateFormat getDateInstance(int style, 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.NullPointerException
- if the locale is null.IllegalArgumentException
- if the style is invalid or
the locale is not one
returned by
LocaleServiceProvider.getAvailableLocales()
DateFormat.getDateInstance(int,java.util.Locale)
public abstract DateFormat getDateTimeInstance(int dateStyle, int timeStyle, 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.NullPointerException
- if the locale is null.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 DateFormat getTimeInstance(int style, 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.NullPointerException
- if the locale is null.IllegalArgumentException
- if the style is invalid or
the locale is not one
returned by
LocaleServiceProvider.getAvailableLocales()
DateFormat.getTimeInstance(int,java.util.Locale)