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