1 /*
2 * Copyright 2006-2016 The JGUIraffe Team.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License")
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package net.sf.jguiraffe.gui.forms;
17
18 /**
19 * <p>
20 * An enumeration class that describes the different validation phases.
21 * </p>
22 * An instance of this class is passed to the
23 * {@link FieldHandler#validate(ValidationPhase)} method. This
24 * method can then determine, which validation to perform.
25 * </p>
26 * <p>
27 * The form framework distinguishes between validation on the field and the form
28 * layer. The field layer deals with syntactic checks. Here the user input is
29 * verified to match the expected data type, e.g. is the text entered by the
30 * user a valid number or a valid date? The form layer is more about semantic.
31 * After the user's input has been transformed into the target data types
32 * constraints for the single fields are checked, e.g. is the number between 0
33 * and 100 or is the date in the future.
34 * </p>
35 *
36 * @author Oliver Heger
37 * @version $Id: ValidationPhase.java 205 2012-01-29 18:29:57Z oheger $
38 */
39 public enum ValidationPhase
40 {
41 /** The validation phase "field". */
42 SYNTAX,
43
44 /** The validation phase "form". */
45 LOGIC;
46 }