public class BigDecimalStringParser extends StringParser
StringParser
for parsing BigDecimals. The parse() method delegates the
actual
parsing to BigDecimal's constructor.StringParser
,
BigDecimal
Constructor and Description |
---|
BigDecimalStringParser()
Deprecated.
Use
getParser() or, even better, JSAP.BIGDECIMAL_PARSER . |
Modifier and Type | Method and Description |
---|---|
static BigDecimalStringParser |
getParser()
Returns a
BigDecimalStringParser . |
Object |
parse(String arg)
Parses the specified argument into a BigDecimal.
|
setUp, tearDown
public BigDecimalStringParser()
getParser()
or, even better, JSAP.BIGDECIMAL_PARSER
.public static BigDecimalStringParser getParser()
BigDecimalStringParser
.
Convenient access to the only instance returned by
this method is available through
JSAP.BIGDECIMAL_PARSER
.
BigDecimalStringParser
.public Object parse(String arg) throws ParseException
new BigDecimal(String)
. If BigDecimal
throws a
NumberFormatException, it is encapsulated into a ParseException and
re-thrown.parse
in class StringParser
arg
- the argument to parseParseException
- if new BigDecimal(arg)
throws a
NumberFormatException.BigDecimal
,
StringParser.parse(String)
Copyright © 2016. All rights reserved.