Coverage Report - org.apache.tapestry.spec.BeanSpecification
 
Classes in this File Line Coverage Branch Coverage Complexity
BeanSpecification
0%
0/28
0%
0/6
1.273
 
 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 java.util.ArrayList;
 18  
 import java.util.List;
 19  
 
 20  
 import org.apache.tapestry.bean.IBeanInitializer;
 21  
 
 22  
 /**
 23  
  * A specification of a helper bean for a component.
 24  
  * 
 25  
  * @author Howard Lewis Ship
 26  
  * @since 1.0.4
 27  
  */
 28  
 
 29  0
 public class BeanSpecification extends LocatablePropertyHolder implements IBeanSpecification
 30  
 {
 31  
     protected String _className;
 32  
 
 33  
     protected BeanLifecycle _lifecycle;
 34  
 
 35  
     /**
 36  
      * A List of {@link IBeanInitializer}.
 37  
      */
 38  
 
 39  
     protected List _initializers;
 40  
 
 41  
     /** @since 1.0.9 * */
 42  
     private String _description;
 43  
 
 44  
     /** @since 4.0 */
 45  
 
 46  
     private String _propertyName;
 47  
     
 48  
     public String getClassName()
 49  
     {
 50  0
         return _className;
 51  
     }
 52  
 
 53  
     public BeanLifecycle getLifecycle()
 54  
     {
 55  0
         return _lifecycle;
 56  
     }
 57  
 
 58  
     /**
 59  
      * @since 1.0.5
 60  
      */
 61  
 
 62  
     public void addInitializer(IBeanInitializer initializer)
 63  
     {
 64  0
         if (_initializers == null)
 65  0
             _initializers = new ArrayList();
 66  
 
 67  0
         _initializers.add(initializer);
 68  0
     }
 69  
 
 70  
     /**
 71  
      * Returns the {@link List}of {@link IBeanInitializer}s. The caller should not modify this
 72  
      * value!. May return null if there are no initializers.
 73  
      * 
 74  
      * @since 1.0.5
 75  
      */
 76  
 
 77  
     public List getInitializers()
 78  
     {
 79  0
         return _initializers;
 80  
     }
 81  
 
 82  
     public String toString()
 83  
     {
 84  0
         StringBuffer buffer = new StringBuffer("BeanSpecification[");
 85  
 
 86  0
         buffer.append(_className);
 87  0
         buffer.append(", lifecycle ");
 88  0
         buffer.append(_lifecycle.getName());
 89  
 
 90  0
         if (_initializers != null && _initializers.size() > 0)
 91  
         {
 92  0
             buffer.append(", ");
 93  0
             buffer.append(_initializers.size());
 94  0
             buffer.append(" initializers");
 95  
         }
 96  
 
 97  0
         buffer.append(']');
 98  
 
 99  0
         return buffer.toString();
 100  
     }
 101  
 
 102  
     public String getDescription()
 103  
     {
 104  0
         return _description;
 105  
     }
 106  
 
 107  
     public void setDescription(String desc)
 108  
     {
 109  0
         _description = desc;
 110  0
     }
 111  
 
 112  
     /** @since 3.0 * */
 113  
 
 114  
     public void setClassName(String className)
 115  
     {
 116  0
         this._className = className;
 117  0
     }
 118  
 
 119  
     /** @since 3.0 * */
 120  
 
 121  
     public void setLifecycle(BeanLifecycle lifecycle)
 122  
     {
 123  0
         this._lifecycle = lifecycle;
 124  0
     }
 125  
 
 126  
     /** @since 4.0 */
 127  
     public String getPropertyName()
 128  
     {
 129  0
         return _propertyName;
 130  
     }
 131  
 
 132  
     /** @since 4.0 */
 133  
     public void setPropertyName(String propertyName)
 134  
     {
 135  0
         _propertyName = propertyName;
 136  0
     }
 137  
 }