public class BooleanOption extends java.lang.Object implements CmdLineOption
CmdLineOption.Parameters
Modifier and Type | Field and Description |
---|---|
boolean |
value
Value of this option.
|
Constructor and Description |
---|
BooleanOption(java.lang.String optionName) |
BooleanOption(java.lang.String optionName,
boolean defaultValue) |
Modifier and Type | Method and Description |
---|---|
boolean |
accepts(java.lang.String optionName)
Checks if this option parser recognizes the specified
option name.
|
boolean |
isOff()
Returns true if this switch is off.
|
boolean |
isOn()
Returns true if this switch is on.
|
int |
parseArguments(CmdLineParser parser,
CmdLineOption.Parameters params)
Called if the option that this parser recognizes is found.
|
public BooleanOption(java.lang.String optionName)
public BooleanOption(java.lang.String optionName, boolean defaultValue)
public boolean accepts(java.lang.String optionName)
CmdLineOption
accepts
in interface CmdLineOption
public int parseArguments(CmdLineParser parser, CmdLineOption.Parameters params) throws CmdLineException
CmdLineOption
parseArguments
in interface CmdLineOption
parser
- The parser that's using this option object.
For example, if the option "-quiet" is simply an alias to
"-verbose 5", then the implementation can just call the
CmdLineParser.parse(String[])
method recursively.params
- The rest of the arguments. This method can use this
object to access the arguments of the option if necessary.CmdLineException
public final boolean isOn()
public final boolean isOff()
Copyright © 2003-2013 Kohsuke Kawaguchi. All Rights Reserved.