protected static enum CommandLineParser.Mode extends java.lang.Enum<CommandLineParser.Mode>
Enum Constant and Description |
---|
BOOLEAN
Argument value is a Boolean.
|
ENUM
Argument value is a String.
|
INTEGER
Argument value is an Integer.
|
STRING
Argument value is a String.
|
STRING_ARRAY
Argument value is a
List <String>. |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
needsExtra()
Returns true if this mode requires an extra parameter.
|
abstract java.lang.Object |
process(CommandLineParser.Arg arg,
java.lang.String extra)
Processes the flag for this argument.
|
static CommandLineParser.Mode |
valueOf(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.
|
public static final CommandLineParser.Mode BOOLEAN
public static final CommandLineParser.Mode INTEGER
public static final CommandLineParser.Mode ENUM
public static final CommandLineParser.Mode STRING
public static final CommandLineParser.Mode STRING_ARRAY
List
<String>. Default value is an empty list.public static CommandLineParser.Mode[] values()
for (CommandLineParser.Mode c : CommandLineParser.Mode.values()) System.out.println(c);
public static CommandLineParser.Mode valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic abstract boolean needsExtra()
public abstract java.lang.Object process(CommandLineParser.Arg arg, java.lang.String extra)
arg
- The argument being processed.extra
- The extra parameter. Null if needsExtra()
returned false.CommandLineParser.Accept.CONTINUE
if this argument can use multiple values and
wishes to receive more.
Or CommandLineParser.Accept.ACCEPT_AND_STOP
if this was the last value accepted by the argument.
Or CommandLineParser.Accept.REJECT_AND_STOP
if 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.