Class DateTimeFunctionFactory

java.lang.Object
com.ibm.icu.message2.DateTimeFunctionFactory
All Implemented Interfaces:
FunctionFactory

class DateTimeFunctionFactory extends Object implements FunctionFactory
Creates a Function doing formatting of date / time, similar to {exp, date} and {exp, time} in MessageFormat. It does not do selection.
  • Field Details

    • kind

      private final String kind
    • DATE_STYLES_TO_SKELETON

      private static Map<String,String> DATE_STYLES_TO_SKELETON
    • TIME_STYLES_TO_SKELETON

      private static Map<String,String> TIME_STYLES_TO_SKELETON
    • ISO_PATTERN

      private static final Pattern ISO_PATTERN
  • Constructor Details

    • DateTimeFunctionFactory

      DateTimeFunctionFactory(String kind)
  • Method Details

    • create

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

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

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

      private static Integer safeParse(String str)
    • parseIso8601

      private static Object parseIso8601(String text)