1 /* 2 * Copyright 1999-2004 The Apache Software Foundation. 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 org.apache.cocoon.acting; 17 18 import org.apache.cocoon.util.EnumerationFactory; 19 20 /** 21 * A number of constants to represent the possible outcomes of a 22 * validation. 23 * 24 * @author <a HREF="mailto:haul@apache.org">Christian Haul</a> 25 * @version CVS $Id: ValidatorActionResult.java 30932 2004-07-29 17:35:38Z vgritsenko $ 26 */ 27 public class ValidatorActionResult extends EnumerationFactory { 28 29 /** 30 * no error occurred, parameter successfully checked. 31 */ 32 public static final ValidatorActionResult 33 OK = new ValidatorActionResult ("OK"); // 0 34 35 /** 36 * this is returned when the result of a validation is 37 * requested but no such result is found in the request 38 * attribute. 39 */ 40 public static final ValidatorActionResult 41 NOTPRESENT = new ValidatorActionResult ("NOTPRESENT"); // 1 42 43 /** 44 * some error occurred, this is a result that is never set but 45 * serves as a comparison target. 46 */ 47 public static final ValidatorActionResult 48 ERROR = new ValidatorActionResult ("ERROR"); // 2 49 50 /** 51 * the parameter is null but isn't allowed to. 52 */ 53 public static final ValidatorActionResult 54 ISNULL = new ValidatorActionResult ("ISNULL"); // 3 55 56 /** 57 * either value or length in case of a string is less than the 58 * specified minimum. 59 */ 60 public static final ValidatorActionResult 61 TOOSMALL = new ValidatorActionResult ("TOOSMALL"); // 4 62 63 /** 64 * either value or length in case of a string is greater than 65 * the specified maximum. 66 */ 67 public static final ValidatorActionResult 68 TOOLARGE = new ValidatorActionResult ("TOOLARGE"); // 5 69 70 /** 71 * a string parameter's value is not matched by the specified 72 * regular expression. 73 */ 74 public static final ValidatorActionResult 75 NOMATCH = new ValidatorActionResult ("NOMATCH"); // 6 76 77 /** 78 * maximum error, only used for comparisons. 79 */ 80 public static final ValidatorActionResult 81 MAXERROR = new ValidatorActionResult ("MAXERROR"); // 7 82 83 /** 84 * Make constructor private to inhibit creation outside. 85 */ 86 private ValidatorActionResult (String image) { 87 super (image); 88 } 89 } 90