Interface FormatPatternProvider


public 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 Details

    • getDatePattern

      @Deprecated default String getDatePattern(DisplayMode mode, Locale locale)

      Returns the localized date pattern suitable for formatting of objects of type PlainDate.

      Parameters:
      mode - display mode
      locale - language and country setting
      Returns:
      localized date pattern
      See Also:
      PlainDate
    • getTimePattern

      @Deprecated default String getTimePattern(DisplayMode mode, Locale locale)

      Returns the localized time pattern suitable for formatting of objects of type PlainTime.

      Parameters:
      mode - display mode
      locale - language and country setting
      Returns:
      localized time pattern
      See Also:
      PlainTime
    • getDateTimePattern

      @Deprecated default String getDateTimePattern(DisplayMode dateMode, DisplayMode timeMode, Locale locale)

      Returns the localized date-time pattern suitable for formatting of objects of type Moment or PlainTimestamp.

      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 part
      timeMode - display mode of time part
      locale - language and country setting
      Returns:
      localized date-time pattern
      See Also:
      Moment, PlainTimestamp
    • getDatePattern

      String getDatePattern(FormatStyle style, Locale locale)

      Returns the localized date pattern suitable for formatting of objects of type PlainDate.

      Parameters:
      style - format style
      locale - language and country setting
      Returns:
      localized date pattern
      Since:
      5.8
      See Also:
      PlainDate
    • getTimePattern

      String getTimePattern(FormatStyle style, Locale locale)

      Returns the localized time pattern suitable for formatting of objects of type PlainTime.

      Parameters:
      style - format style
      locale - language and country setting
      Returns:
      localized time pattern
      Since:
      5.8
      See Also:
      PlainTime
    • getDateTimePattern

      String getDateTimePattern(FormatStyle dateStyle, FormatStyle timeStyle, Locale locale)

      Returns the localized date-time pattern suitable for formatting of objects of type Moment or PlainTimestamp.

      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 part
      timeStyle - format style of time part
      locale - language and country setting
      Returns:
      localized date-time pattern
      Since:
      5.8
      See Also:
      Moment, PlainTimestamp
    • getIntervalPattern

      String getIntervalPattern(Locale locale)

      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