Clover coverage report - Code Coverage for tapestry release 4.0-alpha-3
Coverage timestamp: Mon May 16 2005 09:05:49 EDT
file stats: LOC: 54   Methods: 1
NCLOC: 16   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
BindingUtils.java 100% 100% 100% 100%
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.binding;
 16   
 
 17   
 import org.apache.tapestry.spec.IComponentSpecification;
 18   
 import org.apache.tapestry.spec.IParameterSpecification;
 19   
 
 20   
 /**
 21   
  * @author Howard M. Lewis Ship
 22   
  * @since 4.0
 23   
  */
 24   
 public class BindingUtils
 25   
 {
 26   
     /**
 27   
      * Determines the correct default parameter type (to pass to
 28   
      * {@link org.apache.tapestry.binding.BindingSource#createBinding(IComponent, String, String, String, Location)}
 29   
      * for a component specification and parameter name.
 30   
      * 
 31   
      * @param specification
 32   
      *            the specification of the component for which a binding is being created
 33   
      * @param parameterName
 34   
      *            the name of the parameter to bind which may be either the name of a formal or
 35   
      *            informal parameter
 36   
      * @returns the default binding type defined by the matching {@link IParameterSpecification},
 37   
      *          or {@link BindingConstants.LITERAL_PREFIX} for informal parameters.
 38   
      */
 39  1274
     public static String getDefaultBindingType(IComponentSpecification specification,
 40   
             String parameterName, String metaDefaultBindingType)
 41   
     {
 42  1274
         String result = null;
 43   
 
 44  1274
         IParameterSpecification ps = specification.getParameter(parameterName);
 45   
 
 46  1274
         if (ps != null)
 47  1183
             result = ps.getDefaultBindingType();
 48   
 
 49  1274
         if (result == null)
 50  451
             result = metaDefaultBindingType;
 51   
 
 52  1274
         return result;
 53   
     }
 54   
 }