public class PatternStringParser extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PatternStringParser.ParsedPatternInfo
Contains raw information about the parsed decimal format pattern string.
|
static class |
PatternStringParser.ParsedSubpatternInfo |
| Modifier and Type | Field and Description |
|---|---|
static int |
IGNORE_ROUNDING_ALWAYS |
static int |
IGNORE_ROUNDING_IF_CURRENCY |
static int |
IGNORE_ROUNDING_NEVER |
| Constructor and Description |
|---|
PatternStringParser() |
| Modifier and Type | Method and Description |
|---|---|
static void |
parseToExistingProperties(String pattern,
DecimalFormatProperties properties) |
static void |
parseToExistingProperties(String pattern,
DecimalFormatProperties properties,
int ignoreRounding)
Parses a pattern string into an existing property bag.
|
static PatternStringParser.ParsedPatternInfo |
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 DecimalFormatProperties |
parseToProperties(String pattern) |
static DecimalFormatProperties |
parseToProperties(String pattern,
int ignoreRounding)
Parses a pattern string into a new property bag.
|
public static final int IGNORE_ROUNDING_NEVER
public static final int IGNORE_ROUNDING_IF_CURRENCY
public static final int IGNORE_ROUNDING_ALWAYS
public static PatternStringParser.ParsedPatternInfo parseToPatternInfo(String patternString)
To obtain a more useful form of the data, consider using PatternStringParser.parseToProperties(java.lang.String, int) instead.
patternString - The LDML decimal format pattern (Excel-style pattern) to parse.public static DecimalFormatProperties parseToProperties(String pattern, int ignoreRounding)
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 of
PatternStringParser.IGNORE_ROUNDING_ALWAYS,
PatternStringParser.IGNORE_ROUNDING_IF_CURRENCY, or
PatternStringParser.IGNORE_ROUNDING_NEVER.IllegalArgumentException - If there is a syntax error in the pattern string.public static DecimalFormatProperties parseToProperties(String pattern)
public static void parseToExistingProperties(String pattern, DecimalFormatProperties properties, int ignoreRounding)
pattern - The pattern string, like "#,##0.00"properties - The property bag object to overwrite.ignoreRounding - See PatternStringParser.parseToProperties(String pattern, int ignoreRounding).IllegalArgumentException - If there was a syntax error in the pattern string.public static void parseToExistingProperties(String pattern, DecimalFormatProperties properties)