public abstract class ArgHandlerFlag extends ArgHandler
| Constructor and Description |
|---|
ArgHandlerFlag() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addTagValue(java.lang.String tag,
boolean value) |
abstract boolean |
getDefaultValue()
Returns the default value that will appear in help messages.
|
java.lang.String |
getHelpTag()
The tag to display in help messages.
|
java.lang.String |
getLabel()
The root String that will be munged into -label and -nolabel variants for flag value toggling.
|
java.lang.String |
getPurpose() |
abstract java.lang.String |
getPurposeSnippet()
Returns a description that will be mixed together with default value to come up with the
overall flag purpose.
|
java.lang.String |
getTag()
The primary tag matched by this argument handler.
|
java.lang.String[] |
getTagArgs()
A list of words representing the arguments in help text.
|
java.lang.String[] |
getTags()
The set of tags matched by this argument handler.
|
(package private) boolean |
getValueByTag(java.lang.String tag) |
int |
handle(java.lang.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, isUndocumentedprotected void addTagValue(java.lang.String tag,
boolean value)
public abstract boolean getDefaultValue()
public java.lang.String getHelpTag()
ArgHandlergetHelpTag in class ArgHandlerpublic java.lang.String getLabel()
public final java.lang.String getPurpose()
getPurpose in class ArgHandlerpublic abstract java.lang.String getPurposeSnippet()
public final java.lang.String getTag()
getTag in class ArgHandlerpublic java.lang.String[] getTagArgs()
ArgHandlergetTagArgs in class ArgHandlerpublic final java.lang.String[] getTags()
ArgHandlergetTags in class ArgHandlerboolean getValueByTag(java.lang.String tag)
public int handle(java.lang.String[] args,
int startIndex)
ArgHandlerhandle in class ArgHandlerargs - 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 ArgHandlerpublic abstract boolean setFlag(boolean value)
value - the new value for the flag.