com.martiansoftware.jsap.stringparsers
Class BooleanStringParser

java.lang.Object
  extended bycom.martiansoftware.jsap.StringParser
      extended bycom.martiansoftware.jsap.stringparsers.BooleanStringParser

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.

Author:
Marty Lamb
See Also:
StringParser, Boolean

Constructor Summary
BooleanStringParser()
          Deprecated. Use getParser() or, even better, JSAP.BOOLEAN_PARSER.
 
Method Summary
static BooleanStringParser getParser()
          Returns a BooleanStringParser.
 Object parse(String arg)
          Converts the specified argument into a Boolean.
 
Methods inherited from class com.martiansoftware.jsap.StringParser
setUp, tearDown
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BooleanStringParser

public BooleanStringParser()
Deprecated. Use getParser() or, even better, JSAP.BOOLEAN_PARSER.

Creates a new BooleanStringParser

Method Detail

getParser

public static BooleanStringParser getParser()
Returns a BooleanStringParser.

Convenient access to the only instance returned by this method is available through JSAP.BOOLEAN_PARSER.

Returns:
a BooleanStringParser.

parse

public Object parse(String arg)
             throws ParseException
Converts the specified argument into a Boolean.

When parsing, the following arguments are interpreted as TRUE:



Copyright © 2002-2006, Martian Software, Inc.. All Rights Reserved.
For the latest version and documentation, please visit http://www.martiansoftware.com/jsap