Clover coverage report - Code Coverage for tapestry release 4.0-beta-4
Coverage timestamp: Wed Aug 10 2005 21:19:31 EDT
file stats: LOC: 54   Methods: 0
NCLOC: 6   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ValidatorFactory.java - - - -
coverage
 1    // Copyright 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.form.validator;
 16   
 17    import java.util.List;
 18   
 19    /**
 20    * Constructs {@link org.apache.tapestry.form.validator.Validator} instances from a specification. A
 21    * specification is a comma-seperated list of entries. Each entry is in one of the following forms:
 22    * <ul>
 23    * <li><em>name</em>
 24    * <li><em>name</em>=<em>value</em>
 25    * <li><em>name[<em>message</em>]</em>
 26    * <li><em>name</em>=<em>value</em>[<em>message</em>]
 27    * </ul>
 28    * <p>
 29    * Most validator classes are <em>configurable</em>: they have a property that matches their
 30    * name. For example, {@link org.apache.tapestry.form.validator.MinDate} (which is named "minDate"
 31    * has a <code>minDate</code> property. A few validators are not configurable ("required" =>
 32    * {@link org.apache.tapestry.form.validator.Required}, for example).
 33    * <p>
 34    * Validators are expected to have a public no-args constructor. They are also expected to have a
 35    * <code>message</code> property which is set from the value in brackets.
 36    * <p>
 37    * A full validator specification might be:
 38    * <code>required,email,minLength=20[Email addresses must be at least 20 characters long.]
 39    *
 40    * @author Howard Lewis Ship
 41    * @since 4.0
 42    */
 43    public interface ValidatorFactory
 44    {
 45    /**
 46    * Constructs a new (immutable) List of {@link Validator}, or returns a previously constructed
 47    * List.
 48    *
 49    * @param specification
 50    * a string identifying which validators and their configuration
 51    * @return List of {@link Validator} (possibly empty)
 52    */
 53    public List constructValidatorList(String specification);
 54    }