2009/05/20 - Apache Shale has been retired.

For more information, please explore the Attic.

View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to you under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  package org.apache.shale.tiger.managed.config;
19  
20  import java.util.HashMap;
21  import java.util.Map;
22  
23  /***
24   * <p>Representation of the runtime relevant contents of a JavaServer Faces
25   * <code>&lt;managed-bean&gt;</code> configuration element.</p>
26   */
27  public class ManagedBeanConfig implements ListEntriesHolder, MapEntriesHolder {
28  
29      /*** Creates a new instance of ManagedBeanConfig. */
30      public ManagedBeanConfig() {
31      }
32  
33      /***
34       * Holds value of property name.
35       */
36      private String name;
37  
38      /***
39       * Getter for property name.
40       * @return Value of property name.
41       */
42      public String getName() {
43  
44          return this.name;
45      }
46  
47      /***
48       * Setter for property name.
49       * @param name New value of property name.
50       */
51      public void setName(String name) {
52  
53          this.name = name;
54      }
55  
56      /***
57       * Holds value of property type.
58       */
59      private String type;
60  
61      /***
62       * Getter for property type.
63       * @return Value of property type.
64       */
65      public String getType() {
66  
67          return this.type;
68      }
69  
70      /***
71       * Setter for property type.
72       * @param type New value of property type.
73       */
74      public void setType(String type) {
75  
76          this.type = type;
77      }
78  
79      /***
80       * Holds value of property scope.
81       */
82      private String scope;
83  
84      /***
85       * Getter for property scope.
86       * @return Value of property scope.
87       */
88      public String getScope() {
89  
90          return this.scope;
91      }
92  
93      /***
94       * Setter for property scope.
95       * @param scope New value of property scope.
96       */
97      public void setScope(String scope) {
98  
99          this.scope = scope;
100     }
101 
102     /***
103      * <p>Map of managed properties associated with this managed bean,
104      * keyed by property name.</p>
105      */
106     private Map<String,ManagedPropertyConfig> properties =
107       new HashMap<String,ManagedPropertyConfig>();
108 
109 
110     /***
111      * <p>Add the specified managed property to the set that is associated
112      * with this managed bean, replacing any previous entry.</p>
113      *
114      * @param property The managed property to add
115      */
116     public void addProperty(ManagedPropertyConfig property) {
117         properties.put(property.getName(), property);
118     }
119 
120 
121     /***
122      * <p>Return the list of managed properties associated with this
123      * managed bean.</p>
124      */
125     public Map<String,ManagedPropertyConfig> getProperties() {
126         return this.properties;
127     }
128 
129 
130     /***
131      * <p>Return the managed property (associated with this managed bean)
132      * with the specified name, if any; otherwise, return null.</p>
133      *
134      * @param name Name of the managed property to return
135      */
136     public ManagedPropertyConfig getProperty(String name) {
137         return properties.get(name);
138     }
139 
140     /***
141      * Holds value of property listEntries.
142      */
143     private ListEntriesConfig listEntries;
144 
145     /***
146      * Getter for property listEntries.
147      * @return Value of property listEntries.
148      */
149     public ListEntriesConfig getListEntries() {
150 
151         return this.listEntries;
152     }
153 
154     /***
155      * Setter for property listEntries.
156      * @param listEntries New value of property listEntries.
157      */
158     public void setListEntries(ListEntriesConfig listEntries) {
159 
160         this.listEntries = listEntries;
161     }
162 
163     /***
164      * Holds value of property mapEntries.
165      */
166     private MapEntriesConfig mapEntries;
167 
168     /***
169      * Getter for property mapEntries.
170      * @return Value of property mapEntries.
171      */
172     public MapEntriesConfig getMapEntries() {
173 
174         return this.mapEntries;
175     }
176 
177     /***
178      * Setter for property mapEntries.
179      * @param mapEntries New value of property mapEntries.
180      */
181     public void setMapEntries(MapEntriesConfig mapEntries) {
182 
183         this.mapEntries = mapEntries;
184     }
185 
186 
187 }