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, tearDownpublic ShortStringParser()
getParser() or, even better, JSAP.SHORT_PARSER.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 StringParserarg - the argument to parseParseException - if Short.decode(arg) throws a
NumberFormatException.Short,
StringParser.parse(String)Copyright © 2016. All rights reserved.