KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > clipbuilder > html > bean > FormParamBean


1 package org.jahia.clipbuilder.html.bean;
2
3 import java.util.*;
4
5 /**
6  * Description of the Class
7  *
8  *@author Tlili Khaled
9  */

10 public class FormParamBean extends ParameterBean {
11
12     // attribute
13
private String JavaDoc mapping;
14     private String JavaDoc idAtt;
15     private String JavaDoc type;
16     private String JavaDoc visibility = "true";
17     private String JavaDoc update = "false";
18
19     //related queryBean
20
private QueryParamBean queryParamBean = null;
21
22     // form parent parameter
23
private String JavaDoc formParentName;
24     private String JavaDoc formParentId;
25     private int formParentPosition;
26
27     // List with paramter as string
28
private ArrayList possibleValue = new ArrayList();
29
30     // for struts/hibernate framework
31
private ArrayList possibleBeanValue = new ArrayList();
32
33
34     /**
35      * Constructor for the FormParamBean object
36      *
37      *@param uBean Description of Parameter
38      *@param formParentName Description of Parameter
39      *@param formParentId Description of Parameter
40      *@param formParentPosition Description of Parameter
41      *@param name Description of Parameter
42      *@param type Description of Parameter
43      *@param possibleValue Description of Parameter
44      *@param visibility Description of Parameter
45      *@param position Description of Parameter
46      */

47     public FormParamBean(UrlBean uBean, String JavaDoc formParentName, String JavaDoc formParentId, int formParentPosition, String JavaDoc name, String JavaDoc type, String JavaDoc possibleValue, String JavaDoc visibility, int position) {
48         super(uBean, name, position);
49         setFormParentName(formParentName);
50         setFormParentId(formParentId);
51         setMapping(name);
52         setType(type);
53         setVisibility(visibility);
54         setFormParentPosition(formParentPosition);
55         if (possibleValue != null) {
56             addPossibleValue(possibleValue);
57         }
58     }
59
60
61     /**
62      * Sets the PossibleValue attribute of the ParameterBean object
63      *
64      *@param possibleValue The new PossibleValue value
65      */

66     public void setPossibleValue(ArrayList possibleValue) {
67         this.possibleValue = possibleValue;
68     }
69
70
71     /**
72      * Sets the Mapping attribute of the FormParamBean object
73      *
74      *@param mapping The new Mapping value
75      */

76     public void setMapping(String JavaDoc mapping) {
77         this.mapping = mapping;
78     }
79
80
81     /**
82      * Sets the Type attribute of the FormParamBean object
83      *
84      *@param type The new Type value
85      */

86     public void setType(String JavaDoc type) {
87         this.type = type;
88     }
89
90
91     /**
92      * Sets the PossibleBeanValue attribute of the FormParamBean object
93      *
94      *@param possibleBeanValue The new PossibleBeanValue value
95      */

96     public void setPossibleBeanValue(ArrayList possibleBeanValue) {
97         this.possibleBeanValue = possibleBeanValue;
98     }
99
100
101     /**
102      * Sets the UsedValue attribute of the FormParamBean object
103      *
104      *@param usedValue The new UsedValue value
105      */

106     public void setUsedValue(String JavaDoc usedValue) {
107         QueryParamBean q = getQueryParamBean();
108         if (q != null) {
109             q.setDefaultValue(usedValue);
110         }
111     }
112
113
114     /**
115      * Sets the Visibility attribute of the FormParamBean object
116      *
117      *@param visibility The new Visibility value
118      */

119     public void setVisibility(String JavaDoc visibility) {
120         this.visibility = visibility;
121     }
122
123
124     /**
125      * Sets the QueryParamBean attribute of the FormParamBean object
126      *
127      *@param queryParamBean The new QueryParamBean value
128      */

129     public void setQueryParamBean(QueryParamBean queryParamBean) {
130         this.queryParamBean = queryParamBean;
131         getQueryParamBean().setFormParamBean(this);
132     }
133
134
135     /**
136      * Sets the FormParentName attribute of the FormParamBean object
137      *
138      *@param formParentName The new FormParentName value
139      */

140     public void setFormParentName(String JavaDoc formParentName) {
141         this.formParentName = formParentName;
142     }
143
144
145     /**
146      * Sets the FormParentId attribute of the FormParamBean object
147      *
148      *@param formParentId The new FormParentId value
149      */

150     public void setFormParentId(String JavaDoc formParentId) {
151         this.formParentId = formParentId;
152     }
153
154
155     /**
156      * Sets the FormParentPosition attribute of the FormParamBean object
157      *
158      *@param formParentPosition The new FormParentPosition value
159      */

160     public void setFormParentPosition(int formParentPosition) {
161         this.formParentPosition = formParentPosition;
162     }
163
164
165     /**
166      * Sets the Update attribute of the FormParamBean object
167      *
168      *@param update The new Update value
169      */

170     public void setUpdate(String JavaDoc update) {
171         this.update = update;
172     }
173
174
175     /**
176      * Sets the IdAtt attribute of the FormParamBean object
177      *
178      *@param idAtt The new IdAtt value
179      */

180     public void setIdAtt(String JavaDoc idAtt) {
181         this.idAtt = idAtt;
182     }
183
184
185     /**
186      * Sets the UseAsDefaultValue attribute of the FormParamBean object
187      *
188      *@param useAsDefaultValue The new UseAsDefaultValue value
189      */

190     public void setUseAsDefaultValue(String JavaDoc useAsDefaultValue) {
191         if (getQueryParamBean() != null) {
192             getQueryParamBean().setUseAsDefaultValue(useAsDefaultValue);
193         }
194     }
195
196
197     /**
198      * Gets the UseAsDefaultValue attribute of the FormParamBean object
199      *
200      *@return The UseAsDefaultValue value
201      */

202     public String JavaDoc getUseAsDefaultValue() {
203         if (getQueryParamBean() != null) {
204             return getQueryParamBean().getUseAsDefaultValue();
205         }
206         else {
207             return "";
208         }
209     }
210
211
212
213     /**
214      * Gets the PossibleValue attribute of the ParameterBean object
215      *
216      *@return The PossibleValue value
217      */

218     public ArrayList getListPossibleStringValue() {
219         return possibleValue;
220     }
221
222
223     /**
224      * Gets the Type attribute of the FormParamBean object
225      *
226      *@return The Type value
227      */

228     public String JavaDoc getType() {
229         return type;
230     }
231
232
233     /**
234      * Gets the Mapping attribute of the FormParamBean object
235      *
236      *@return The Mapping value
237      */

238     public String JavaDoc getMapping() {
239         return mapping;
240     }
241
242
243     /**
244      * Gets the UsedValue attribute of the FormParamBean object
245      *
246      *@return The UsedValue value
247      */

248     public String JavaDoc getUsedValue() {
249         QueryParamBean q = getQueryParamBean();
250         if (q == null) {
251             return "";
252         }
253         return q.getDefaultValue();
254     }
255
256
257     /**
258      * Gets the PossibleBeanValue attribute of the FormParamBean object
259      *
260      *@return The PossibleBeanValue value
261      */

262     public ArrayList getPossibleBeanValue() {
263         return possibleBeanValue;
264     }
265
266
267     /**
268      * Gets the Visibility attribute of the FormParamBean object
269      *
270      *@return The Visibility value
271      */

272     public String JavaDoc getVisibility() {
273         return visibility;
274     }
275
276
277     /**
278      * Gets the QueryParamBean attribute of the FormParamBean object
279      *
280      *@return The QueryParamBean value
281      */

282     public QueryParamBean getQueryParamBean() {
283         return queryParamBean;
284     }
285
286
287     /**
288      * Gets the FormParentName attribute of the FormParamBean object
289      *
290      *@return The FormParentName value
291      */

292     public String JavaDoc getFormParentName() {
293         return formParentName;
294     }
295
296
297     /**
298      * Gets the FormParentId attribute of the FormParamBean object
299      *
300      *@return The FormParentId value
301      */

302     public String JavaDoc getFormParentId() {
303         return formParentId;
304     }
305
306
307     /**
308      * Gets the FormParentPosition attribute of the FormParamBean object
309      *
310      *@return The FormParentPosition value
311      */

312     public int getFormParentPosition() {
313         return formParentPosition;
314     }
315
316
317     /**
318      * Gets the Update attribute of the FormParamBean object
319      *
320      *@return The Update value
321      */

322     public String JavaDoc getUpdate() {
323         return update;
324     }
325
326
327     /**
328      * Gets the IdAtt attribute of the FormParamBean object
329      *
330      *@return The IdAtt value
331      */

332     public String JavaDoc getIdAtt() {
333         return idAtt;
334     }
335
336
337
338     /**
339      * Gets the PossibleBeanValue attribute of the FormParamBean object
340      *
341      *@return The PossibleBeanValue value
342      */

343     public ArrayList getListPossibleBeanValue() {
344         return possibleBeanValue;
345     }
346
347
348     /**
349      * Adds a feature to the PossibleValue attribute of the ParameterBean object
350      *
351      *@param value The feature to be added to the PossibleValue attribute
352      */

353     public void addPossibleValue(String JavaDoc value) {
354         ParamValueBean avb = new ParamValueBean(this, value);
355         getListPossibleBeanValue().add(avb);
356         getListPossibleStringValue().add(value);
357     }
358 }
359
Popular Tags