public abstract class ArgHandlerFlag extends ArgHandler
Constructor and Description |
---|
ArgHandlerFlag() |
Modifier and Type | Method and Description |
---|---|
protected void |
addTagValue(String tag,
boolean value) |
abstract boolean |
getDefaultValue()
Returns the default value that will appear in help messages.
|
String |
getHelpTag()
The tag to display in help messages.
|
String |
getLabel()
The root String that will be munged into -label and -nolabel variants for flag value toggling.
|
String |
getPurpose() |
abstract String |
getPurposeSnippet()
Returns a description that will be mixed together with default value to come up with the
overall flag purpose.
|
String |
getTag()
The primary tag matched by this argument handler.
|
String[] |
getTagArgs()
A list of words representing the arguments in help text.
|
String[] |
getTags()
The set of tags matched by this argument handler.
|
int |
handle(String[] args,
int startIndex)
Attempts to process one flag or "extra" command-line argument (that appears
without a flag).
|
boolean |
isRequired() |
abstract boolean |
setFlag(boolean value)
Takes the explicitly provided value and propagates it into whatever option settings this flag
controls.
|
getDefaultArgs, isExperimental, isUndocumented
protected void addTagValue(String tag, boolean value)
public abstract boolean getDefaultValue()
public String getHelpTag()
ArgHandler
getHelpTag
in class ArgHandler
public String getLabel()
public final String getPurpose()
getPurpose
in class ArgHandler
public abstract String getPurposeSnippet()
public final String getTag()
getTag
in class ArgHandler
public String[] getTagArgs()
ArgHandler
getTagArgs
in class ArgHandler
public final String[] getTags()
ArgHandler
getTags
in class ArgHandler
public int handle(String[] args, int startIndex)
ArgHandler
handle
in class ArgHandler
args
- the arguments passed in to main()startIndex
- an index into args indicating the first argument to use.
If this is a handler for a flag argument. Otherwise it's the index of the
"extra" argument.public boolean isRequired()
isRequired
in class ArgHandler
public abstract boolean setFlag(boolean value)
value
- the new value for the flag.Copyright © 2018. All rights reserved.