Coverage Report - org.apache.myfaces.config.impl.digester.elements.ManagedBean
 
Classes in this File Line Coverage Branch Coverage Complexity
ManagedBean
0%
0/35
0%
0/10
0
 
 1  
 /*
 2  
  * Licensed to the Apache Software Foundation (ASF) under one
 3  
  * or more contributor license agreements.  See the NOTICE file
 4  
  * distributed with this work for additional information
 5  
  * regarding copyright ownership.  The ASF licenses this file
 6  
  * to you under the Apache License, Version 2.0 (the
 7  
  * "License"); you may not use this file except in compliance
 8  
  * with the License.  You may obtain a copy of the License at
 9  
  *
 10  
  *   http://www.apache.org/licenses/LICENSE-2.0
 11  
  *
 12  
  * Unless required by applicable law or agreed to in writing,
 13  
  * software distributed under the License is distributed on an
 14  
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 15  
  * KIND, either express or implied.  See the License for the
 16  
  * specific language governing permissions and limitations
 17  
  * under the License.
 18  
  */
 19  
 package org.apache.myfaces.config.impl.digester.elements;
 20  
 
 21  
 import org.apache.myfaces.shared_impl.util.ClassUtils;
 22  
 
 23  
 import java.util.ArrayList;
 24  
 import java.util.Iterator;
 25  
 import java.util.List;
 26  
 
 27  
 
 28  
 /**
 29  
  * @author <a href="mailto:oliver@rossmueller.com">Oliver Rossmueller</a>
 30  
  */
 31  0
 public class ManagedBean implements org.apache.myfaces.config.element.ManagedBean
 32  
 {
 33  
 
 34  
     private String description;
 35  
     private String name;
 36  
     private String beanClassName;
 37  
     private Class beanClass;
 38  
     private String scope;
 39  0
     private List<ManagedProperty> property = new ArrayList<ManagedProperty>();
 40  
     private MapEntries mapEntries;
 41  
     private ListEntries listEntries;
 42  
 
 43  
 
 44  
     public int getInitMode()
 45  
     {
 46  0
         if (mapEntries != null) {
 47  0
             return INIT_MODE_MAP;
 48  
         }
 49  0
         if (listEntries != null) {
 50  0
             return INIT_MODE_LIST;
 51  
         }
 52  0
         if (! property.isEmpty()) {
 53  0
             return INIT_MODE_PROPERTIES;
 54  
         }
 55  0
         return INIT_MODE_NO_INIT;
 56  
     }
 57  
 
 58  
 
 59  
 
 60  
     public org.apache.myfaces.config.element.MapEntries getMapEntries()
 61  
     {
 62  0
         return mapEntries;
 63  
     }
 64  
 
 65  
 
 66  
     public void setMapEntries(MapEntries mapEntries)
 67  
     {
 68  0
         this.mapEntries = mapEntries;
 69  0
     }
 70  
 
 71  
 
 72  
     public org.apache.myfaces.config.element.ListEntries getListEntries()
 73  
     {
 74  0
         return listEntries;
 75  
     }
 76  
 
 77  
 
 78  
     public void setListEntries(ListEntries listEntries)
 79  
     {
 80  0
         this.listEntries = listEntries;
 81  0
     }
 82  
 
 83  
 
 84  
     public String getDescription() {
 85  0
         return description;
 86  
     }
 87  
     
 88  
     public void setDescription(String description) {
 89  0
         this.description = description;
 90  0
     }
 91  
     
 92  
     public String getManagedBeanName()
 93  
     {
 94  0
         return name;
 95  
     }
 96  
 
 97  
 
 98  
     public void setName(String name)
 99  
     {
 100  0
         this.name = name;
 101  0
     }
 102  
 
 103  
 
 104  
     public String getManagedBeanClassName()
 105  
     {
 106  0
         return beanClassName;
 107  
     }
 108  
 
 109  
 
 110  
     public Class getManagedBeanClass()
 111  
     {
 112  0
         if (beanClassName == null)
 113  
         {
 114  0
             return null;
 115  
         }
 116  0
         if (beanClass == null)
 117  
         {
 118  0
             beanClass = ClassUtils.simpleClassForName(beanClassName);
 119  
         }
 120  0
         return beanClass;
 121  
     }
 122  
 
 123  
 
 124  
     public void setBeanClass(String beanClass)
 125  
     {
 126  0
         this.beanClassName = beanClass;
 127  0
     }
 128  
 
 129  
 
 130  
     public String getManagedBeanScope()
 131  
     {
 132  0
         return scope;
 133  
     }
 134  
 
 135  
 
 136  
     public void setScope(String scope)
 137  
     {
 138  0
         this.scope = scope;
 139  0
     }
 140  
 
 141  
 
 142  
     public void addProperty(ManagedProperty value)
 143  
     {
 144  0
         property.add(value);
 145  0
     }
 146  
 
 147  
 
 148  
     public Iterator<ManagedProperty> getManagedProperties()
 149  
     {
 150  0
         return property.iterator();
 151  
     }
 152  
 }