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