Coverage Report - org.apache.tapestry.parse.BeanSetPropertySetter
 
Classes in this File Line Coverage Branch Coverage Complexity
BeanSetPropertySetter
0%
0/12
0%
0/2
1.333
 
 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.parse;
 16  
 
 17  
 import org.apache.hivemind.impl.BaseLocatable;
 18  
 import org.apache.tapestry.bean.BindingBeanInitializer;
 19  
 import org.apache.tapestry.spec.IBeanSpecification;
 20  
 
 21  
 /**
 22  
  * Holds the data from a <set-property> element while the body is being parsed.
 23  
  * 
 24  
  * @author Howard Lewis Ship
 25  
  */
 26  
 class BeanSetPropertySetter extends BaseLocatable
 27  
 {
 28  
     private IBeanSpecification _beanSpecification;
 29  
 
 30  
     private BindingBeanInitializer _initializer;
 31  
 
 32  
     private String _bindingReference;
 33  
 
 34  
     private String _prefix;
 35  
 
 36  
     BeanSetPropertySetter(IBeanSpecification beanSpecification, BindingBeanInitializer initializer,
 37  
             String prefix, String expression)
 38  0
     {
 39  0
         _beanSpecification = beanSpecification;
 40  0
         _initializer = initializer;
 41  0
         _prefix = prefix;
 42  0
         _bindingReference = expression;
 43  0
     }
 44  
 
 45  
     void applyBindingReference(String bindingReference)
 46  
     {
 47  0
         String fullBindingReference = _prefix == null ? bindingReference : _prefix
 48  
                 + bindingReference;
 49  
 
 50  0
         _initializer.setBindingReference(fullBindingReference);
 51  
 
 52  0
         _beanSpecification.setLocation(getLocation());
 53  0
         _beanSpecification.addInitializer(_initializer);
 54  0
     }
 55  
 
 56  
     public String getBindingReference()
 57  
     {
 58  0
         return _bindingReference;
 59  
     }
 60  
 
 61  
 }