01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.cocoon.acting;
18:
19: import org.apache.cocoon.util.EnumerationFactory;
20:
21: /**
22: * A number of constants to represent the possible outcomes of a
23: * validation.
24: *
25: * @author <a href="mailto:haul@apache.org">Christian Haul</a>
26: * @version CVS $Id: ValidatorActionResult.java 433543 2006-08-22 06:22:54Z crossley $
27: */
28: public class ValidatorActionResult extends EnumerationFactory {
29:
30: /**
31: * no error occurred, parameter successfully checked.
32: */
33: public static final ValidatorActionResult OK = new ValidatorActionResult(
34: "OK"); // 0
35:
36: /**
37: * this is returned when the result of a validation is
38: * requested but no such result is found in the request
39: * attribute.
40: */
41: public static final ValidatorActionResult NOTPRESENT = new ValidatorActionResult(
42: "NOTPRESENT"); // 1
43:
44: /**
45: * some error occurred, this is a result that is never set but
46: * serves as a comparison target.
47: */
48: public static final ValidatorActionResult ERROR = new ValidatorActionResult(
49: "ERROR"); // 2
50:
51: /**
52: * the parameter is null but isn't allowed to.
53: */
54: public static final ValidatorActionResult ISNULL = new ValidatorActionResult(
55: "ISNULL"); // 3
56:
57: /**
58: * either value or length in case of a string is less than the
59: * specified minimum.
60: */
61: public static final ValidatorActionResult TOOSMALL = new ValidatorActionResult(
62: "TOOSMALL"); // 4
63:
64: /**
65: * either value or length in case of a string is greater than
66: * the specified maximum.
67: */
68: public static final ValidatorActionResult TOOLARGE = new ValidatorActionResult(
69: "TOOLARGE"); // 5
70:
71: /**
72: * a string parameter's value is not matched by the specified
73: * regular expression.
74: */
75: public static final ValidatorActionResult NOMATCH = new ValidatorActionResult(
76: "NOMATCH"); // 6
77:
78: /**
79: * maximum error, only used for comparisons.
80: */
81: public static final ValidatorActionResult MAXERROR = new ValidatorActionResult(
82: "MAXERROR"); // 7
83:
84: /**
85: * Make constructor private to inhibit creation outside.
86: */
87: private ValidatorActionResult(String image) {
88: super(image);
89: }
90: }
|