Class SimpleDateTimeFormatStyleProvider

java.lang.Object
org.threeten.bp.format.DateTimeFormatStyleProvider
org.threeten.bp.format.SimpleDateTimeFormatStyleProvider

final class SimpleDateTimeFormatStyleProvider extends DateTimeFormatStyleProvider
The Service Provider Implementation to obtain date-time formatters for a style.

This implementation is based on extraction of data from a SimpleDateFormat.

Specification for implementors

This class is immutable and thread-safe.
  • Field Details

  • Constructor Details

    • SimpleDateTimeFormatStyleProvider

      SimpleDateTimeFormatStyleProvider()
  • Method Details

    • getAvailableLocales

      public Locale[] getAvailableLocales()
      Description copied from class: DateTimeFormatStyleProvider
      Gets the available locales.
      Overrides:
      getAvailableLocales in class DateTimeFormatStyleProvider
      Returns:
      the locales
    • getFormatter

      public DateTimeFormatter getFormatter(FormatStyle dateStyle, FormatStyle timeStyle, Chronology chrono, Locale locale)
      Description copied from class: DateTimeFormatStyleProvider
      Gets a localized date, time or date-time formatter.

      The formatter will be the most appropriate to use for the date and time style in the locale. For example, some locales will use the month name while others will use the number.

      Specified by:
      getFormatter in class DateTimeFormatStyleProvider
      Parameters:
      dateStyle - the date formatter style to obtain, null to obtain a time formatter
      timeStyle - the time formatter style to obtain, null to obtain a date formatter
      chrono - the chronology to use, not null
      locale - the locale to use, not null
      Returns:
      the date-time formatter, not null
    • convertStyle

      private int convertStyle(FormatStyle style)
      Converts the enum style to the old format style.
      Parameters:
      style - the enum style, not null
      Returns:
      the int style