Package net.sf.jguiraffe.gui.forms
Enum ValidationPhase
- java.lang.Object
-
- java.lang.Enum<ValidationPhase>
-
- net.sf.jguiraffe.gui.forms.ValidationPhase
-
- All Implemented Interfaces:
Serializable
,Comparable<ValidationPhase>
public enum ValidationPhase extends Enum<ValidationPhase>
An enumeration class that describes the different validation phases.
An instance of this class is passed to theFieldHandler.validate(ValidationPhase)
method. This method can then determine, which validation to perform.The form framework distinguishes between validation on the field and the form layer. The field layer deals with syntactic checks. Here the user input is verified to match the expected data type, e.g. is the text entered by the user a valid number or a valid date? The form layer is more about semantic. After the user's input has been transformed into the target data types constraints for the single fields are checked, e.g. is the number between 0 and 100 or is the date in the future.
- Version:
- $Id: ValidationPhase.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ValidationPhase
valueOf(String name)
Returns the enum constant of this type with the specified name.static ValidationPhase[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SYNTAX
public static final ValidationPhase SYNTAX
The validation phase "field".
-
LOGIC
public static final ValidationPhase LOGIC
The validation phase "form".
-
-
Method Detail
-
values
public static ValidationPhase[] 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 (ValidationPhase c : ValidationPhase.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ValidationPhase 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 nameNullPointerException
- if the argument is null
-
-