Top Description Constructors Methods
java.text.spi

public abstract Class DateFormatProvider

extends LocaleServiceProvider
Class Inheritance
Known Direct Subclasses
sun.util.locale.provider.DateFormatProviderImpl, sun.util.locale.provider.SPILocaleProviderAdapter.DateFormatProviderDelegate
Imports
java.text.DateFormat, java.util.Locale, java.util.spi.LocaleServiceProvider

An abstract class for service providers that provide concrete implementations of the DateFormat class.
Since
1.6

Constructor Summary

AccessConstructor and Description
protected
DateFormatProvider()

Sole constructor.

Method Summary

Modifier and TypeMethod and Description
public abstract DateFormat

Returns:

a date formatter.
getDateInstance
(int
the given formatting style. Either one of DateFormat.SHORT, DateFormat.MEDIUM, DateFormat.LONG, or DateFormat.FULL.
style
,
Locale
the desired locale.
locale
)

Returns a new DateFormat instance which formats date with the given formatting style for the specified locale.

public abstract DateFormat

Returns:

a date/time formatter.
getDateTimeInstance
(int
the given date formatting style. Either one of DateFormat.SHORT, DateFormat.MEDIUM, DateFormat.LONG, or DateFormat.FULL.
dateStyle
,
int
the given time formatting style. Either one of DateFormat.SHORT, DateFormat.MEDIUM, DateFormat.LONG, or DateFormat.FULL.
timeStyle
,
Locale
the desired locale.
locale
)

Returns a new DateFormat instance which formats date and time with the given formatting style for the specified locale.

public abstract DateFormat

Returns:

a time formatter.
getTimeInstance
(int
the given formatting style. Either one of DateFormat.SHORT, DateFormat.MEDIUM, DateFormat.LONG, or DateFormat.FULL.
style
,
Locale
the desired locale.
locale
)

Returns a new DateFormat instance which formats time with the given formatting style for the specified locale.

Inherited from java.util.spi.LocaleServiceProvider:
getAvailableLocalesisSupportedLocale

Constructor Detail

DateFormatProviderback to summary
protected DateFormatProvider()

Sole constructor. (For invocation by subclass constructors, typically implicit.)

Method Detail

getDateInstanceback to summary
public abstract DateFormat getDateInstance(int style, Locale locale)

Returns a new DateFormat instance which formats date with the given formatting style for the specified locale.

Parameters
style:int

the given formatting style. Either one of DateFormat.SHORT, DateFormat.MEDIUM, DateFormat.LONG, or DateFormat.FULL.

locale:Locale

the desired locale.

Returns:DateFormat

a date formatter.

Exceptions
IllegalArgumentException:
if style is invalid, or if locale isn't one of the locales returned from getAvailableLocales().
NullPointerException:
if locale is null
See Also
java.text.DateFormat#getDateInstance(int, java.util.Locale)
getDateTimeInstanceback to summary
public abstract DateFormat getDateTimeInstance(int dateStyle, int timeStyle, Locale locale)

Returns a new DateFormat instance which formats date and time with the given formatting style for the specified locale.

Parameters
dateStyle:int

the given date formatting style. Either one of DateFormat.SHORT, DateFormat.MEDIUM, DateFormat.LONG, or DateFormat.FULL.

timeStyle:int

the given time formatting style. Either one of DateFormat.SHORT, DateFormat.MEDIUM, DateFormat.LONG, or DateFormat.FULL.

locale:Locale

the desired locale.

Returns:DateFormat

a date/time formatter.

Exceptions
IllegalArgumentException:
if dateStyle or timeStyle is invalid, or if locale isn't one of the locales returned from getAvailableLocales().
NullPointerException:
if locale is null
See Also
java.text.DateFormat#getDateTimeInstance(int, int, java.util.Locale)
getTimeInstanceback to summary
public abstract DateFormat getTimeInstance(int style, Locale locale)

Returns a new DateFormat instance which formats time with the given formatting style for the specified locale.

Parameters
style:int

the given formatting style. Either one of DateFormat.SHORT, DateFormat.MEDIUM, DateFormat.LONG, or DateFormat.FULL.

locale:Locale

the desired locale.

Returns:DateFormat

a time formatter.

Exceptions
IllegalArgumentException:
if style is invalid, or if locale isn't one of the locales returned from getAvailableLocales().
NullPointerException:
if locale is null
See Also
java.text.DateFormat#getTimeInstance(int, java.util.Locale)