|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.android.sdklib.util.CommandLineParser.Arg
protected static class CommandLineParser.Arg
An argument accepted by the command-line, also called "a flag".
Arguments must have a short version (one letter), a long version name and a description.
They can have a default value, or it can be null.
Depending on the CommandLineParser.Mode
, the default value can be a Boolean, an Integer, a String
or a String array (in which case the first item is the current by default.)
Constructor Summary | |
---|---|
CommandLineParser.Arg(CommandLineParser.Mode mode,
boolean mandatory,
java.lang.String verb,
java.lang.String directObject,
java.lang.String shortName,
java.lang.String longName,
java.lang.String description,
java.lang.Object defaultValue)
Creates a new argument flag description. |
Method Summary | |
---|---|
java.lang.Object |
getCurrentValue()
Returns the current value. |
java.lang.Object |
getDefaultValue()
Returns the default value. |
java.lang.String |
getDescription()
Returns the description. |
java.lang.String |
getDirectObject()
Returns the direct Object for that argument. |
java.lang.String |
getLongArg()
Returns the long name of the argument, e.g. |
CommandLineParser.Mode |
getMode()
Returns the argument mode (type + process method). |
java.lang.String |
getShortArg()
Returns the 1-letter short name of the argument, e.g. |
java.lang.String |
getVerb()
Returns the verb for that argument. |
boolean |
isInCommandLine()
Returns true if the argument has been used on the command line. |
boolean |
isMandatory()
Return true if this argument is mandatory for this verb/directobject. |
void |
setCurrentValue(java.lang.Object currentValue)
Sets the current value. |
void |
setInCommandLine(boolean inCommandLine)
Sets if the argument has been used on the command line. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommandLineParser.Arg(CommandLineParser.Mode mode, boolean mandatory, @NonNull java.lang.String verb, @NonNull java.lang.String directObject, @NonNull java.lang.String shortName, @NonNull java.lang.String longName, @NonNull java.lang.String description, @Nullable java.lang.Object defaultValue)
mode
- The CommandLineParser.Mode
for the argument.mandatory
- True if this argument is mandatory for this action.verb
- The verb name. Never null. Can be CommandLineParser.GLOBAL_FLAG_VERB
.directObject
- The action name. Can be CommandLineParser.NO_VERB_OBJECT
.shortName
- The one-letter short argument name. Can be empty but not null.longName
- The long argument name. Can be empty but not null.description
- The description. Cannot be null.defaultValue
- The default value (or values), which depends on the selected
CommandLineParser.Mode
. Can be null.Method Detail |
---|
public boolean isMandatory()
public java.lang.String getShortArg()
public java.lang.String getLongArg()
public java.lang.String getDescription()
public java.lang.String getVerb()
public java.lang.String getDirectObject()
public java.lang.Object getDefaultValue()
public java.lang.Object getCurrentValue()
public void setCurrentValue(java.lang.Object currentValue)
public CommandLineParser.Mode getMode()
public boolean isInCommandLine()
public void setInCommandLine(boolean inCommandLine)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |