Interface FormatPatternProvider
This SPI-interface enables the access to localized gregorian
date-, time- or interval patterns according to the CLDR-specifiation and is instantiated via a
ServiceLoader
-mechanism.
If there is no external FormatPatternProvider
then Time4J will
just delegate to the JDK.
Specification: Implementations must have a public no-arg constructor.
- Since:
- 3.10/4.7
- Author:
- Meno Hochschild
- See Also:
ServiceLoader
,SimpleDateFormat.toPattern()
-
Method Summary
Modifier and TypeMethodDescriptiongetDatePattern(FormatStyle style, Locale locale)
Returns the localized date pattern suitable for formatting of objects of typePlainDate
.default String
getDatePattern(DisplayMode mode, Locale locale)
Deprecated.getDateTimePattern(FormatStyle dateStyle, FormatStyle timeStyle, Locale locale)
Returns the localized date-time pattern suitable for formatting of objects of typeMoment
orPlainTimestamp
.default String
getDateTimePattern(DisplayMode dateMode, DisplayMode timeMode, Locale locale)
Deprecated.getIntervalPattern(Locale locale)
Returns the localized interval pattern.getTimePattern(FormatStyle style, Locale locale)
Returns the localized time pattern suitable for formatting of objects of typePlainTime
.default String
getTimePattern(DisplayMode mode, Locale locale)
Deprecated.
-
Method Details
-
getDatePattern
Deprecated.Returns the localized date pattern suitable for formatting of objects of type
PlainDate
.- Parameters:
mode
- display modelocale
- language and country setting- Returns:
- localized date pattern
- See Also:
PlainDate
-
getTimePattern
Deprecated.Returns the localized time pattern suitable for formatting of objects of type
PlainTime
.- Parameters:
mode
- display modelocale
- language and country setting- Returns:
- localized time pattern
- See Also:
PlainTime
-
getDateTimePattern
@Deprecated default String getDateTimePattern(DisplayMode dateMode, DisplayMode timeMode, Locale locale)Deprecated.Returns the localized date-time pattern suitable for formatting of objects of type
Moment
orPlainTimestamp
.Expressions of the form "{0}" will be interpreted as the time component and expressions of the form "{1}" will be interpreted as the date component. All other chars of the pattern will be treated as literals.
- Parameters:
dateMode
- display mode of date parttimeMode
- display mode of time partlocale
- language and country setting- Returns:
- localized date-time pattern
- See Also:
Moment
,PlainTimestamp
-
getDatePattern
Returns the localized date pattern suitable for formatting of objects of type
PlainDate
.- Parameters:
style
- format stylelocale
- language and country setting- Returns:
- localized date pattern
- Since:
- 5.8
- See Also:
PlainDate
-
getTimePattern
Returns the localized time pattern suitable for formatting of objects of type
PlainTime
.- Parameters:
style
- format stylelocale
- language and country setting- Returns:
- localized time pattern
- Since:
- 5.8
- See Also:
PlainTime
-
getDateTimePattern
Returns the localized date-time pattern suitable for formatting of objects of type
Moment
orPlainTimestamp
.Expressions of the form "{0}" will be interpreted as the time component and expressions of the form "{1}" will be interpreted as the date component. All other chars of the pattern will be treated as literals.
- Parameters:
dateStyle
- format style of date parttimeStyle
- format style of time partlocale
- language and country setting- Returns:
- localized date-time pattern
- Since:
- 5.8
- See Also:
Moment
,PlainTimestamp
-
getIntervalPattern
Returns the localized interval pattern.
Expressions of the form "{0}" will be interpreted as the start boundary format and expressions of the form "{1}" will be interpreted as the end boundary format. All other chars of the pattern will be treated as literals.
- Parameters:
locale
- language and country setting- Returns:
- localized interval pattern
-
getDatePattern(FormatStyle, Locale)