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: 134   Methods: 10
NCLOC: 49   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
ParameterSpecification.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.spec;
 16   
 
 17   
 import org.apache.hivemind.impl.BaseLocatable;
 18   
 
 19   
 /**
 20   
  * Defines a formal parameter to a component. A <code>IParameterSpecification</code> is contained
 21   
  * by a {@link IComponentSpecification}.
 22   
  * <p>
 23   
  * TBD: Identify arrays in some way.
 24   
  * 
 25   
  * @author Howard Lewis Ship
 26   
  */
 27   
 
 28   
 public class ParameterSpecification extends BaseLocatable implements IParameterSpecification
 29   
 {
 30   
     private boolean _required = false;
 31   
 
 32   
     private String _type;
 33   
 
 34   
     /** @since 1.0.9 * */
 35   
     private String _description;
 36   
 
 37   
     /** @since 2.0.3 * */
 38   
     private String _propertyName;
 39   
 
 40   
     /** @since 3.0 * */
 41   
     private String _defaultValue = null;
 42   
 
 43   
     /**
 44   
      * Returns the class name of the expected type of the parameter. The default value is
 45   
      * <code>java.lang.Object</code> which matches anything.
 46   
      */
 47   
 
 48  1338
     public String getType()
 49   
     {
 50  1338
         return _type;
 51   
     }
 52   
 
 53   
     /**
 54   
      * Returns true if the parameter is required by the component. The default is false, meaning the
 55   
      * parameter is optional.
 56   
      */
 57   
 
 58  4689
     public boolean isRequired()
 59   
     {
 60  4689
         return _required;
 61   
     }
 62   
 
 63  1341
     public void setRequired(boolean value)
 64   
     {
 65  1341
         _required = value;
 66   
     }
 67   
 
 68   
     /**
 69   
      * Sets the type of value expected for the parameter. This can be left blank to indicate any
 70   
      * type.
 71   
      */
 72   
 
 73  60
     public void setType(String value)
 74   
     {
 75  60
         _type = value;
 76   
     }
 77   
 
 78   
     /**
 79   
      * Returns the documentation for this parameter.
 80   
      * 
 81   
      * @since 1.0.9
 82   
      */
 83   
 
 84  1
     public String getDescription()
 85   
     {
 86  1
         return _description;
 87   
     }
 88   
 
 89   
     /**
 90   
      * Sets the documentation for this parameter.
 91   
      * 
 92   
      * @since 1.0.9
 93   
      */
 94   
 
 95  925
     public void setDescription(String description)
 96   
     {
 97  925
         _description = description;
 98   
     }
 99   
 
 100   
     /**
 101   
      * Sets the property name (of the component class) to connect the parameter to.
 102   
      */
 103   
 
 104  1344
     public void setPropertyName(String propertyName)
 105   
     {
 106  1344
         _propertyName = propertyName;
 107   
     }
 108   
 
 109   
     /**
 110   
      * Returns the name of the JavaBeans property to connect the parameter to.
 111   
      */
 112   
 
 113  1339
     public String getPropertyName()
 114   
     {
 115  1339
         return _propertyName;
 116   
     }
 117   
 
 118   
     /**
 119   
      * @see org.apache.tapestry.spec.IParameterSpecification#getDefaultValue()
 120   
      */
 121  4225
     public String getDefaultValue()
 122   
     {
 123  4225
         return _defaultValue;
 124   
     }
 125   
 
 126   
     /**
 127   
      * @see org.apache.tapestry.spec.IParameterSpecification#setDefaultValue(java.lang.String)
 128   
      */
 129  1341
     public void setDefaultValue(String defaultValue)
 130   
     {
 131  1341
         _defaultValue = defaultValue;
 132   
     }
 133   
 
 134   
 }