|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kohsuke.args4j.opts.BooleanOption
public class BooleanOption
Boolean option. The presence of the option sets the flag. Also, it recognized -opt- -opt+ to turn on/off the flag respectively.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.kohsuke.args4j.CmdLineOption |
---|
CmdLineOption.Parameters |
Field Summary | |
---|---|
boolean |
value
Value of this option. |
Constructor Summary | |
---|---|
BooleanOption(String optionName)
|
|
BooleanOption(String optionName,
boolean defaultValue)
|
Method Summary | |
---|---|
boolean |
accepts(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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public boolean value
Constructor Detail |
---|
public BooleanOption(String optionName)
public BooleanOption(String optionName, boolean defaultValue)
Method Detail |
---|
public boolean accepts(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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |