Class DateTimeFormatterFactory

java.lang.Object
com.ibm.icu.message2.DateTimeFormatterFactory
All Implemented Interfaces:
FormatterFactory

class DateTimeFormatterFactory extends Object implements FormatterFactory
Creates a Formatter doing formatting of date / time, similar to {exp, date} and {exp, time} in MessageFormat.
  • Field Details

    • kind

      private final String kind
    • ISO_PATTERN

      private static final Pattern ISO_PATTERN
  • Constructor Details

    • DateTimeFormatterFactory

      DateTimeFormatterFactory(String kind)
  • Method Details

    • stringToStyle

      private static int stringToStyle(String option)
    • createFormatter

      public Formatter createFormatter(Locale locale, Map<String,Object> fixedOptions)
      The method that is called to create a formatter.
      Specified by:
      createFormatter in interface FormatterFactory
      Parameters:
      locale - the locale to use for formatting.
      fixedOptions - the options to use for formatting. The keys and values are function dependent.
      Returns:
      the formatter.
      Throws:
      IllegalArgumentException - when something goes wrong (for example conflicting options, invalid option values, etc.)
    • getDateTimeStyle

      private static int getDateTimeStyle(Map<String,Object> options, String key)
    • getDateFieldOptions

      private static String getDateFieldOptions(Map<String,Object> options)
    • getTimeFieldOptions

      private static String getTimeFieldOptions(Map<String,Object> options)
    • safeParse

      private static Integer safeParse(String str)
    • parseIso8601

      private static Object parseIso8601(String text)