Class PatternStringParser
java.lang.Object
org.graalvm.shadowed.com.ibm.icu.impl.number.PatternStringParser
Implements a recursive descent parser for decimal format patterns.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classContains raw information about the parsed decimal format pattern string.static class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidparseToExistingProperties(String pattern, DecimalFormatProperties properties) static voidparseToExistingProperties(String pattern, DecimalFormatProperties properties, int ignoreRounding) Parses a pattern string into an existing property bag.parseToPatternInfo(String patternString) Runs the recursive descent parser on the given pattern string, returning a data structure with raw information about the pattern string.static DecimalFormatPropertiesparseToProperties(String pattern) static DecimalFormatPropertiesparseToProperties(String pattern, int ignoreRounding) Parses a pattern string into a new property bag.
-
Field Details
-
IGNORE_ROUNDING_NEVER
public static final int IGNORE_ROUNDING_NEVER- See Also:
-
IGNORE_ROUNDING_IF_CURRENCY
public static final int IGNORE_ROUNDING_IF_CURRENCY- See Also:
-
IGNORE_ROUNDING_ALWAYS
public static final int IGNORE_ROUNDING_ALWAYS- See Also:
-
-
Constructor Details
-
PatternStringParser
public PatternStringParser()
-
-
Method Details
-
parseToPatternInfo
Runs the recursive descent parser on the given pattern string, returning a data structure with raw information about the pattern string.To obtain a more useful form of the data, consider using
parseToProperties(String, int)instead.- Parameters:
patternString- The LDML decimal format pattern (Excel-style pattern) to parse.- Returns:
- The results of the parse.
-
parseToProperties
Parses a pattern string into a new property bag.- Parameters:
pattern- The pattern string, like "#,##0.00"ignoreRounding- Whether to leave out rounding information (minFrac, maxFrac, and rounding increment) when parsing the pattern. This may be desirable if a custom rounding mode, such as CurrencyUsage, is to be used instead. One ofIGNORE_ROUNDING_ALWAYS,IGNORE_ROUNDING_IF_CURRENCY, orIGNORE_ROUNDING_NEVER.- Returns:
- A property bag object.
- Throws:
IllegalArgumentException- If there is a syntax error in the pattern string.
-
parseToProperties
-
parseToExistingProperties
public static void parseToExistingProperties(String pattern, DecimalFormatProperties properties, int ignoreRounding) Parses a pattern string into an existing property bag. All properties that can be encoded into a pattern string will be overwritten with either their default value or with the value coming from the pattern string. Properties that cannot be encoded into a pattern string, such as rounding mode, are not modified.- Parameters:
pattern- The pattern string, like "#,##0.00"properties- The property bag object to overwrite.ignoreRounding- SeeparseToProperties(String pattern, int ignoreRounding).- Throws:
IllegalArgumentException- If there was a syntax error in the pattern string.
-
parseToExistingProperties
-