info.rolandkrueger.roklib.cli
Enum CommandLineArgumentEvaluator.UserInputValidity

java.lang.Object
  extended by java.lang.Enum<CommandLineArgumentEvaluator.UserInputValidity>
      extended by info.rolandkrueger.roklib.cli.CommandLineArgumentEvaluator.UserInputValidity
All Implemented Interfaces:
Serializable, Comparable<CommandLineArgumentEvaluator.UserInputValidity>
Enclosing class:
CommandLineArgumentEvaluator

public static enum CommandLineArgumentEvaluator.UserInputValidity
extends Enum<CommandLineArgumentEvaluator.UserInputValidity>

Enum which is used to describe whether the arguments provided by the user via the command line were valid and if not so, what was wrong about them. After the command line arguments have been evaluated with CommandLineArgumentEvaluator.evaluate() the result of this evaluation can be queried with CommandLineArgumentEvaluator.getInputStatus(). This method returns OK if the argument list was valid or some of the other values if it was not. In case of an invalid argument list, the returned value indicates the type of error made by the user.

See Also:
CommandLineArgumentEvaluator.getInputStatus()

Enum Constant Summary
DUPLICATE_OPTION
           One option has been given more than once.
MISSING_ARGUMENT
          If a (CommandLineOptionType.LIST) option or a ( CommandLineOptionType.SINGULAR) option was used like a ( CommandLineOptionType.FLAG) option this type of error will be indicated.
MISSING_ASSOCIATE_OPTION
          There are two CommandLineOptions which have been configured as associate options.
MUTUALLY_EXCLUSIVE_OPTIONS_GIVEN
           If two options have been configured as being mutually exclusive then using both of them in the argument list will result in this error type.
NOT_YET_EVALUATED
          Information about the validity of the user input is not yet available.
OK
          Everything is OK, the user input is valid.
TOO_FEW_OPTIONS
          There are too few options.
TOO_MANY_VALUES
          The user has either provided a value for a flag option or given more than one values for a singular option.
UNRECOGNIZED_OPTION
          The user has given an option that is unknown, i.e. it is not contained in the internal option list.
 
Method Summary
static CommandLineArgumentEvaluator.UserInputValidity valueOf(String name)
          Returns the enum constant of this type with the specified name.
static CommandLineArgumentEvaluator.UserInputValidity[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NOT_YET_EVALUATED

public static final CommandLineArgumentEvaluator.UserInputValidity NOT_YET_EVALUATED
Information about the validity of the user input is not yet available. This is only the case after invoking CommandLineArgumentEvaluator.evaluate(). If CommandLineArgumentEvaluator.getInputStatus() is called before evaluating the argument list an exception is raised.


OK

public static final CommandLineArgumentEvaluator.UserInputValidity OK
Everything is OK, the user input is valid.


UNRECOGNIZED_OPTION

public static final CommandLineArgumentEvaluator.UserInputValidity UNRECOGNIZED_OPTION
The user has given an option that is unknown, i.e. it is not contained in the internal option list.


TOO_FEW_OPTIONS

public static final CommandLineArgumentEvaluator.UserInputValidity TOO_FEW_OPTIONS
There are too few options. Not every mandatory option has been provided.


TOO_MANY_VALUES

public static final CommandLineArgumentEvaluator.UserInputValidity TOO_MANY_VALUES
The user has either provided a value for a flag option or given more than one values for a singular option.


MISSING_ASSOCIATE_OPTION

public static final CommandLineArgumentEvaluator.UserInputValidity MISSING_ASSOCIATE_OPTION
There are two CommandLineOptions which have been configured as associate options. Thus, if one of them is used in the argument list, the other option must also be provided. If only one of two associate options is used, though, the input status of this CommandLineArgumentEvaluator is set to this value.


MISSING_ARGUMENT

public static final CommandLineArgumentEvaluator.UserInputValidity MISSING_ARGUMENT
If a (CommandLineOptionType.LIST) option or a ( CommandLineOptionType.SINGULAR) option was used like a ( CommandLineOptionType.FLAG) option this type of error will be indicated. I. e., if such an option has not been provided with any value the input status of this CommandLineArgumentEvaluator is set to this value.


MUTUALLY_EXCLUSIVE_OPTIONS_GIVEN

public static final CommandLineArgumentEvaluator.UserInputValidity MUTUALLY_EXCLUSIVE_OPTIONS_GIVEN

If two options have been configured as being mutually exclusive then using both of them in the argument list will result in this error type.

The two mutually exclusive options which have both been used can be queried with CommandLineArgumentEvaluator.getMutuallyExclusiveOptionsBeingUsed() .


DUPLICATE_OPTION

public static final CommandLineArgumentEvaluator.UserInputValidity DUPLICATE_OPTION

One option has been given more than once. This option hasn't been configured as an option which can be given multiple times. Therefore, it is not allowed to repeat this option.

The duplicate option can be queried with CommandLineArgumentEvaluator.getErroneousOption().

See Also:
CommandLineOption.allowOptionRepetition(boolean)
Method Detail

values

public static CommandLineArgumentEvaluator.UserInputValidity[] 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 (CommandLineArgumentEvaluator.UserInputValidity c : CommandLineArgumentEvaluator.UserInputValidity.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static CommandLineArgumentEvaluator.UserInputValidity valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


Copyright © 2007-2011. All Rights Reserved.