Package com.ibm.icu.message2
Class DateTimeFormatterFactory
- java.lang.Object
-
- com.ibm.icu.message2.DateTimeFormatterFactory
-
- All Implemented Interfaces:
FormatterFactory
class DateTimeFormatterFactory extends java.lang.Object implements FormatterFactory
Creates aFormatter
doing formatting of date / time, similar to{exp, date}
and{exp, time}
inMessageFormat
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
DateTimeFormatterFactory.DateTimeFormatter
-
Field Summary
Fields Modifier and Type Field Description private static java.util.regex.Pattern
ISO_PATTERN
private java.lang.String
kind
-
Constructor Summary
Constructors Constructor Description DateTimeFormatterFactory(java.lang.String kind)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Formatter
createFormatter(java.util.Locale locale, java.util.Map<java.lang.String,java.lang.Object> fixedOptions)
The method that is called to create a formatter.private static java.lang.String
getDateFieldOptions(java.util.Map<java.lang.String,java.lang.Object> options)
private static int
getDateTimeStyle(java.util.Map<java.lang.String,java.lang.Object> options, java.lang.String key)
private static java.lang.String
getTimeFieldOptions(java.util.Map<java.lang.String,java.lang.Object> options)
private static java.lang.Object
parseIso8601(java.lang.String text)
private static java.lang.Integer
safeParse(java.lang.String str)
private static int
stringToStyle(java.lang.String option)
-
-
-
Method Detail
-
stringToStyle
private static int stringToStyle(java.lang.String option)
-
createFormatter
public Formatter createFormatter(java.util.Locale locale, java.util.Map<java.lang.String,java.lang.Object> fixedOptions)
The method that is called to create a formatter.- Specified by:
createFormatter
in interfaceFormatterFactory
- 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:
java.lang.IllegalArgumentException
- when something goes wrong (for example conflicting options, invalid option values, etc.)
-
getDateTimeStyle
private static int getDateTimeStyle(java.util.Map<java.lang.String,java.lang.Object> options, java.lang.String key)
-
getDateFieldOptions
private static java.lang.String getDateFieldOptions(java.util.Map<java.lang.String,java.lang.Object> options)
-
getTimeFieldOptions
private static java.lang.String getTimeFieldOptions(java.util.Map<java.lang.String,java.lang.Object> options)
-
safeParse
private static java.lang.Integer safeParse(java.lang.String str)
-
parseIso8601
private static java.lang.Object parseIso8601(java.lang.String text)
-
-