public class BooleanStringParser extends StringParser
A StringParser
for parsing Booleans. This StringParser is also used
internally
by the Switch class.
When parsing, the following arguments are interpreted as TRUE:
The following arguments are interpreted as FALSE:
All other input throws a ParseException.
StringParser
,
Boolean
Constructor and Description |
---|
BooleanStringParser()
Deprecated.
Use
getParser() or, even better, JSAP.BOOLEAN_PARSER . |
Modifier and Type | Method and Description |
---|---|
static BooleanStringParser |
getParser()
Returns a
BooleanStringParser . |
Object |
parse(String arg)
Converts the specified argument into a Boolean.
|
setUp, tearDown
public BooleanStringParser()
public static BooleanStringParser getParser()
BooleanStringParser
.
Convenient access to the only instance returned by
this method is available through
JSAP.BOOLEAN_PARSER
.
BooleanStringParser
.public Object parse(String arg) throws ParseException
When parsing, the following arguments are interpreted as TRUE:
The following arguments are interpreted as FALSE:
All other input throws a ParseException.
parse
in class StringParser
arg
- the argument to convert to a Boolean.ParseException
- if none of the above cases are matched.Copyright © 2015. All rights reserved.