net.sourceforge.stripes.validation
Enum ValidationState

java.lang.Object
  extended by java.lang.Enum<ValidationState>
      extended by net.sourceforge.stripes.validation.ValidationState
All Implemented Interfaces:
Serializable, Comparable<ValidationState>

public enum ValidationState
extends Enum<ValidationState>

Enumeration that describes the choices for when validation methods should be run. Allows developers to choose between having their validation methods run always, only when there are no errors, or to adopt the system default policy.

Since:
Stripes 1.3
Author:
Tim Fennell

Enum Constant Summary
ALWAYS
          Specifies that validations should be applied in all conditions without regard for whether there are pre-existing validation errors.
DEFAULT
          Specifies that the decision of whether or not the validation should be applied when errors exist should be made by consulting the system level default.
NO_ERRORS
          Specifies that validations should be applied only when there are no validation errors.
 
Method Summary
static ValidationState valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ValidationState[] 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

ALWAYS

public static final ValidationState ALWAYS
Specifies that validations should be applied in all conditions without regard for whether there are pre-existing validation errors.


NO_ERRORS

public static final ValidationState NO_ERRORS
Specifies that validations should be applied only when there are no validation errors.


DEFAULT

public static final ValidationState DEFAULT
Specifies that the decision of whether or not the validation should be applied when errors exist should be made by consulting the system level default. Stripes' default for the system level value is equivalent to NO_ERRORS, but can be configured. See the Stripes Configuration Reference for details.

Method Detail

values

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

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

valueOf

public static ValidationState 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 2005-2006, Stripes Development Team.