1 16 package org.apache.myfaces.config.impl.digester.elements; 17 18 import org.apache.myfaces.util.ClassUtils; 19 20 import java.util.ArrayList ; 21 import java.util.Iterator ; 22 import java.util.List ; 23 24 25 28 public class ManagedBean implements org.apache.myfaces.config.element.ManagedBean 29 { 30 31 private String name; 32 private String beanClassName; 33 private Class beanClass; 34 private String scope; 35 private List property = new ArrayList (); 36 private MapEntries mapEntries; 37 private ListEntries listEntries; 38 39 40 public int getInitMode() 41 { 42 if (mapEntries != null) { 43 return INIT_MODE_MAP; 44 } 45 if (listEntries != null) { 46 return INIT_MODE_LIST; 47 } 48 if (! property.isEmpty()) { 49 return INIT_MODE_PROPERTIES; 50 } 51 return INIT_MODE_NO_INIT; 52 } 53 54 55 56 public org.apache.myfaces.config.element.MapEntries getMapEntries() 57 { 58 return mapEntries; 59 } 60 61 62 public void setMapEntries(MapEntries mapEntries) 63 { 64 this.mapEntries = mapEntries; 65 } 66 67 68 public org.apache.myfaces.config.element.ListEntries getListEntries() 69 { 70 return listEntries; 71 } 72 73 74 public void setListEntries(ListEntries listEntries) 75 { 76 this.listEntries = listEntries; 77 } 78 79 80 public String getManagedBeanName() 81 { 82 return name; 83 } 84 85 86 public void setName(String name) 87 { 88 this.name = name; 89 } 90 91 92 public String getManagedBeanClassName() 93 { 94 return beanClassName; 95 } 96 97 98 public Class getManagedBeanClass() 99 { 100 if (beanClassName == null) 101 { 102 return null; 103 } 104 if (beanClass == null) 105 { 106 beanClass = ClassUtils.simpleClassForName(beanClassName); 107 } 108 return beanClass; 109 } 110 111 112 public void setBeanClass(String beanClass) 113 { 114 this.beanClassName = beanClass; 115 } 116 117 118 public String getManagedBeanScope() 119 { 120 return scope; 121 } 122 123 124 public void setScope(String scope) 125 { 126 this.scope = scope; 127 } 128 129 130 public void addProperty(ManagedProperty value) 131 { 132 property.add(value); 133 } 134 135 136 public Iterator getManagedProperties() 137 { 138 return property.iterator(); 139 } 140 } 141 | Popular Tags |