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 . |
java.lang.Object |
parse(java.lang.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 java.lang.Object parse(java.lang.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 © 2002-2006, Martian Software, Inc.. All Rights Reserved.
For the latest version and documentation, please visit http://www.martiansoftware.com/jsap