Clover coverage report - Code Coverage for tapestry release 3.1-alpha-1
Coverage timestamp: Mon Feb 21 2005 09:16:14 EST
file stats: LOC: 105   Methods: 11
NCLOC: 54   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
FieldTracking.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.tapestry.IRender;
 18   
 import org.apache.tapestry.form.IFormComponent;
 19   
 
 20   
 /**
 21   
  *  Default implementation of {@link IFieldTracking}.
 22   
  *
 23   
  *  @author Howard Lewis Ship
 24   
  *  @since 1.0.8
 25   
  *
 26   
  **/
 27   
 
 28   
 public class FieldTracking implements IFieldTracking
 29   
 {
 30   
     private IFormComponent _component;
 31   
     private String _input;
 32   
     private IRender _renderer;
 33   
     private String _fieldName;
 34   
     private ValidationConstraint _constraint;
 35   
 
 36   
     /**
 37   
      *  Constructor used for unassociated errors; errors that are not about any particular
 38   
      *  field within the form.
 39   
      * 
 40   
      **/
 41   
     
 42  1
     FieldTracking()
 43   
     {
 44   
     }
 45   
 
 46   
     /**
 47   
      *  Standard constructor for a field (with the given name), rendered
 48   
      *  by the specified component.
 49   
      * 
 50   
      **/
 51   
     
 52  21
     FieldTracking(String fieldName, IFormComponent component)
 53   
     {
 54  21
         _fieldName = fieldName;
 55  21
         _component = component;
 56   
     }
 57   
 
 58  11
     public IFormComponent getComponent()
 59   
     {
 60  11
         return _component;
 61   
     }
 62   
 
 63  16
     public IRender getErrorRenderer()
 64   
     {
 65  16
         return _renderer;
 66   
     }
 67   
 
 68  10
     public void setErrorRenderer(IRender value)
 69   
     {
 70  10
         _renderer = value;
 71   
     }
 72   
 
 73  6
     public String getInput()
 74   
     {
 75  6
         return _input;
 76   
     }
 77   
 
 78  19
     public void setInput(String value)
 79   
     {
 80  19
         _input = value;
 81   
     }
 82   
 
 83  9
     public String getFieldName()
 84   
     {
 85  9
         return _fieldName;
 86   
     }
 87   
 
 88  3
     public ValidationConstraint getConstraint()
 89   
     {
 90  3
         return _constraint;
 91   
     }
 92   
 
 93  10
     public void setConstraint(ValidationConstraint constraint)
 94   
     {
 95  10
         _constraint = constraint;
 96   
     }
 97   
 
 98   
     /** @since 3.0 **/
 99   
 
 100  34
     public boolean isInError()
 101   
     {
 102  34
         return _renderer != null;
 103   
     }
 104   
 
 105   
 }