Class NumberFormatParser
java.lang.Object
de.xima.fc.form.common.number_format.NumberFormatParser
Parses a formatted numeric string, according to the formatting rules from an
NumberFormatOptions instance.- Since:
- 8.2.2
-
Method Summary
Modifier and TypeMethodDescriptionstatic NumberFormatParsernewParser(NumberFormatOptions options) Creates a new parser for parsing formatted numeric strings, according to the givenformatting rules.Parses a formatted numeric string according to the formatting rules of this instance.static BigDecimalparse(String value, NumberFormatOptions options) Parses a formatted numeric string, according to the formatting rules from anNumberFormatOptionsinstance.
-
Method Details
-
parse
Parses a formatted numeric string according to the formatting rules of this instance. When the value represents no number (empty string or just a unit), returns null.- Parameters:
value- The formatted numeric string.- Returns:
- The parsed numeric value.
- Throws:
NumberFormatParseException- If the value cannot be parsed.
-
newParser
Creates a new parser for parsing formatted numeric strings, according to the givenformatting rules.- Parameters:
options- The formatting rules.- Returns:
- A new parser for the given formatting rules.
-
parse
public static BigDecimal parse(String value, NumberFormatOptions options) throws NumberFormatParseException Parses a formatted numeric string, according to the formatting rules from anNumberFormatOptionsinstance.- Parameters:
value- The formatted numeric string.options- The formatting rules.- Returns:
- The parsed numeric value.
- Throws:
NumberFormatParseException- If the value cannot be parsed.
-