Package com.android.sdklib.util
Enum CommandLineParser.Mode
- java.lang.Object
-
- java.lang.Enum<CommandLineParser.Mode>
-
- com.android.sdklib.util.CommandLineParser.Mode
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<CommandLineParser.Mode>
- Enclosing class:
- CommandLineParser
protected static enum CommandLineParser.Mode extends java.lang.Enum<CommandLineParser.Mode>
The mode of an argument specifies the type of variable it represents, whether an extra parameter is required after the flag and how to parse it.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BOOLEANArgument value is a Boolean.ENUMArgument value is a String.INTEGERArgument value is an Integer.STRINGArgument value is a String.STRING_ARRAYArgument value is aList<String>.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleanneedsExtra()Returns true if this mode requires an extra parameter.abstract java.lang.Objectprocess(CommandLineParser.Arg arg, java.lang.String extra)Processes the flag for this argument.static CommandLineParser.ModevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static CommandLineParser.Mode[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BOOLEAN
public static final CommandLineParser.Mode BOOLEAN
Argument value is a Boolean. Default value is a Boolean.
-
INTEGER
public static final CommandLineParser.Mode INTEGER
Argument value is an Integer. Default value is an Integer.
-
ENUM
public static final CommandLineParser.Mode ENUM
Argument value is a String. Default value is a String[].
-
STRING
public static final CommandLineParser.Mode STRING
Argument value is a String. Default value is a null.
-
STRING_ARRAY
public static final CommandLineParser.Mode STRING_ARRAY
Argument value is aList<String>. Default value is an empty list.
-
-
Method Detail
-
values
public static CommandLineParser.Mode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CommandLineParser.Mode c : CommandLineParser.Mode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CommandLineParser.Mode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
needsExtra
public abstract boolean needsExtra()
Returns true if this mode requires an extra parameter.
-
process
public abstract java.lang.Object process(CommandLineParser.Arg arg, java.lang.String extra)
Processes the flag for this argument.- Parameters:
arg- The argument being processed.extra- The extra parameter. Null ifneedsExtra()returned false.- Returns:
CommandLineParser.Accept.CONTINUEif this argument can use multiple values and wishes to receive more. OrCommandLineParser.Accept.ACCEPT_AND_STOPif this was the last value accepted by the argument. OrCommandLineParser.Accept.REJECT_AND_STOPif this was value was reject and the argument stops accepting new values with no error. Or a string in case of error. Never returns null.
-
-