Clover coverage report - Code Coverage for tapestry release 4.0-alpha-2
Coverage timestamp: Thu May 5 2005 09:57:44 EDT
file stats: LOC: 133   Methods: 1
NCLOC: 23   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
ValidationConstraint.java - 100% 100% 100%
coverage
 1   
 // Copyright 2004, 2005 The Apache Software Foundation
 2   
 //
 3   
 // Licensed under the Apache License, Version 2.0 (the "License");
 4   
 // you may not use this file except in compliance with the License.
 5   
 // You may obtain a copy of the License at
 6   
 //
 7   
 //     http://www.apache.org/licenses/LICENSE-2.0
 8   
 //
 9   
 // Unless required by applicable law or agreed to in writing, software
 10   
 // distributed under the License is distributed on an "AS IS" BASIS,
 11   
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12   
 // See the License for the specific language governing permissions and
 13   
 // limitations under the License.
 14   
 
 15   
 package org.apache.tapestry.valid;
 16   
 
 17   
 import org.apache.commons.lang.enum.Enum;
 18   
 
 19   
 /**
 20   
  *  Defines an enumeration of different types of validation constraints
 21   
  *  that may be violated.
 22   
  *
 23   
  *  @author Howard Lewis Ship
 24   
  * 
 25   
  **/
 26   
 
 27   
 public class ValidationConstraint extends Enum
 28   
 {
 29   
     /**
 30   
      *  Indicates that no value (or a value consisting only of white space) was
 31   
      *  provided for a field that requires a non-null value.
 32   
      *
 33   
      **/
 34   
 
 35   
     public static final ValidationConstraint REQUIRED = new ValidationConstraint("REQUIRED");
 36   
 
 37   
     /**
 38   
      *  Indicates that a non-null value was provided, but that (after removing
 39   
      *  leading and trailing whitespace), the value was not long enough.
 40   
      *
 41   
      **/
 42   
 
 43   
     public static final ValidationConstraint MINIMUM_WIDTH =
 44   
         new ValidationConstraint("MINUMUM_WIDTH");
 45   
 
 46   
     /**
 47   
      *  Indicates a general error in converting a String into a Date.
 48   
      *
 49   
      **/
 50   
 
 51   
     public static final ValidationConstraint DATE_FORMAT = new ValidationConstraint("DATE_FORMAT");
 52   
 
 53   
     /**
 54   
      *  Indicates a general error in the format of a string that is
 55   
      *  to be interpreted as a email.
 56   
      *
 57   
      **/
 58   
 
 59   
     public static final ValidationConstraint EMAIL_FORMAT =
 60   
         new ValidationConstraint("EMAIL_FORMAT");
 61   
 
 62   
     /**
 63   
      *  Indicates a general error in the format of a string that is
 64   
      *  to be interpreted as a number.
 65   
      *
 66   
      **/
 67   
 
 68   
     public static final ValidationConstraint NUMBER_FORMAT =
 69   
         new ValidationConstraint("NUMBER_FORMAT");
 70   
 
 71   
     /**
 72   
      *  Indicates that the value was too small (for a Date, too early).
 73   
      *
 74   
      **/
 75   
 
 76   
     public static final ValidationConstraint TOO_SMALL = new ValidationConstraint("TOO_SMALL");
 77   
 
 78   
     /**
 79   
      *  Indicates that the value was too large (for a Date, too late).
 80   
      *
 81   
      **/
 82   
 
 83   
     public static final ValidationConstraint TOO_LARGE = new ValidationConstraint("TOO_LARGE");
 84   
 
 85   
     /**
 86   
      *  Indicates an error in a string that does not fulfill a pattern.
 87   
      * 
 88   
      *  @since 3.0
 89   
      * 
 90   
      **/
 91   
 
 92   
     public static final ValidationConstraint PATTERN_MISMATCH =
 93   
         new ValidationConstraint("PATTERN_MISMATCH");
 94   
 
 95   
     /**
 96   
      *  Indicates a consistency error, usually between too different fields.
 97   
      * 
 98   
      *  @since 3.0
 99   
      * 
 100   
      **/
 101   
 
 102   
     public static final ValidationConstraint CONSISTENCY = new ValidationConstraint("CONSISTENCY");
 103   
 
 104   
     /**
 105   
      *  Indicates that a URL is not of the correct format
 106   
      * 
 107   
      * @since 3.0
 108   
      */
 109   
     
 110   
     public static final ValidationConstraint URL_FORMAT = new ValidationConstraint("URL_FORMAT");
 111   
 
 112   
     /**
 113   
      *  Indicates that the URL does not use one of the specified protocols
 114   
      * 
 115   
      * @since 3.0
 116   
      */
 117   
 
 118   
     public static final ValidationConstraint DISALLOWED_PROTOCOL = new ValidationConstraint("DISALLOWED_PROTOCOL");
 119   
 
 120   
 
 121   
 
 122   
     /**
 123   
      *  Protected constructor, which allows new constraints to be created
 124   
      *  as subclasses.
 125   
      * 
 126   
      **/
 127   
 
 128  11
     protected ValidationConstraint(String name)
 129   
     {
 130  11
         super(name);
 131   
     }
 132   
 
 133   
 }