KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > struts > taglib > SimpleBeanForTesting


1 /*
2  * $Id: SimpleBeanForTesting.java 54929 2004-10-16 16:38:42Z germuska $
3  *
4  * Copyright 1999-2004 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * 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, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 package org.apache.struts.taglib;
20
21 import java.util.Collection JavaDoc;
22 import java.util.Enumeration JavaDoc;
23 import java.util.List JavaDoc;
24 import java.util.Map JavaDoc;
25
26 import org.apache.struts.action.ActionForm;
27
28 /**
29  * Simple bean for unit tests.
30  *
31  */

32 public class SimpleBeanForTesting extends ActionForm {
33     public SimpleBeanForTesting() {
34         super();
35     }
36     public SimpleBeanForTesting(List JavaDoc lst) {
37         this.lst = lst;
38     }
39     public SimpleBeanForTesting(boolean checked) {
40         this.checked = checked;
41     }
42     public SimpleBeanForTesting(Boolean JavaDoc checkedWrapper) {
43         this.checkedWrapper = checkedWrapper;
44     }
45     public SimpleBeanForTesting(Map JavaDoc map) {
46         this.map = map;
47     }
48     public SimpleBeanForTesting(String JavaDoc string) {
49         this.string = string;
50     }
51     public SimpleBeanForTesting(String JavaDoc[] stringArray) {
52         this.stringArray = stringArray;
53     }
54     public SimpleBeanForTesting(Integer JavaDoc integerValue) {
55         this.integerValue = integerValue;
56     }
57
58     private String JavaDoc string;
59     private String JavaDoc[] stringArray;
60     private Integer JavaDoc integerValue;
61     private Double JavaDoc doubleValue;
62     private List JavaDoc lst;
63     private Map JavaDoc map;
64     private String JavaDoc x;
65     private String JavaDoc y;
66     private Object JavaDoc nestedObject;
67     private Object JavaDoc[] array;
68     private Enumeration JavaDoc enumeration;
69     private Collection JavaDoc collection;
70     private boolean checked;
71     private Boolean JavaDoc checkedWrapper;
72
73     //Copied right from the FAQ
74
private String JavaDoc strAry[] =
75         { "String 0", "String 1", "String 2", "String 3", "String 4" };
76
77     public String JavaDoc getStringIndexed(int index) {
78         return (strAry[index]);
79     }
80     public void setStringIndexed(int index, String JavaDoc value) {
81         strAry[index] = value;
82     }
83
84     /**
85      * Returns the lst.
86      * @return List
87      */

88     public List JavaDoc getList() {
89         return lst;
90     }
91
92     /**
93      * Returns the map.
94      * @return Map
95      */

96     public Map JavaDoc getMap() {
97         return map;
98     }
99
100     /**
101      * Sets the lst.
102      * @param lst The lst to set
103      */

104     public void setList(List JavaDoc lst) {
105         this.lst = lst;
106     }
107
108     /**
109      * Sets the map.
110      * @param map The map to set
111      */

112     public void setMap(Map JavaDoc map) {
113         this.map = map;
114     }
115
116     /**
117      * Returns the string.
118      * @return String
119      */

120     public String JavaDoc getString() {
121         return string;
122     }
123
124     /**
125      * Sets the string.
126      * @param string The string to set
127      */

128     public void setString(String JavaDoc string) {
129         this.string = string;
130     }
131
132     /**
133      * Returns an array of type String.
134      * @return String[]
135      */

136     public String JavaDoc[] getStringArray() {
137         return stringArray;
138     }
139
140     /**
141      * Sets the string array.
142      * @param string The string array to set
143      */

144     public void setStringArray(String JavaDoc[] stringArray) {
145         this.stringArray = stringArray;
146     }
147
148     /**
149      * Returns the lst.
150      * @return List
151      */

152     public List JavaDoc getLst() {
153         return lst;
154     }
155
156     /**
157      * Sets the lst.
158      * @param lst The lst to set
159      */

160     public void setLst(List JavaDoc lst) {
161         this.lst = lst;
162     }
163
164     /**
165      * Returns the Object Array.
166      * @return Object[]
167      */

168     public Object JavaDoc[] getArray() {
169         return array;
170     }
171
172     /**
173      * Sets the Object Array .
174      * @param array The Object array to set
175      */

176     public void setArray(Object JavaDoc[] array) {
177         this.array = array;
178     }
179
180     /**
181      * Returns the enumeration.
182      * @return Enumeration
183      */

184     public Enumeration JavaDoc getEnumeration() {
185         return enumeration;
186     }
187
188     /**
189      * Sets the enumeration.
190      * @param enumeration The enumeration to set
191      */

192     public void setEnumeration(Enumeration JavaDoc enumeration) {
193         this.enumeration = enumeration;
194     }
195
196     /**
197      * Returns the nestedObject.
198      * @return Object
199      */

200     public Object JavaDoc getNestedObject() {
201         return nestedObject;
202     }
203
204     /**
205      * Sets the nestedObject.
206      * @param nestedObject The nestedObject to set
207      */

208     public void setNestedObject(Object JavaDoc nestedObject) {
209         this.nestedObject = nestedObject;
210     }
211
212     /**
213      * Returns the collection.
214      * @return Collection
215      */

216     public Collection JavaDoc getCollection() {
217         return collection;
218     }
219
220     /**
221      * Sets the collection.
222      * @param collection The collection to set
223      */

224     public void setCollection(Collection JavaDoc collection) {
225         this.collection = collection;
226     }
227
228     /**
229      * Returns the doubleValue.
230      * @return Double
231      */

232     public Double JavaDoc getDoubleValue() {
233         return doubleValue;
234     }
235
236     /**
237      * Returns the integerValue.
238      * @return Integer
239      */

240     public Integer JavaDoc getIntegerValue() {
241         return integerValue;
242     }
243
244     /**
245      * Sets the doubleValue.
246      * @param doubleValue The doubleValue to set
247      */

248     public void setDoubleValue(Double JavaDoc doubleValue) {
249         this.doubleValue = doubleValue;
250     }
251
252     /**
253      * Sets the integerValue.
254      * @param integerValue The integerValue to set
255      */

256     public void setIntegerValue(Integer JavaDoc integerValue) {
257         this.integerValue = integerValue;
258     }
259
260     /**
261      * Returns the checked.
262      * @return boolean
263      */

264     public boolean isChecked() {
265         return checked;
266     }
267
268     /**
269      * Sets the checked.
270      * @param checked The checked to set
271      */

272     public void setChecked(boolean checked) {
273         this.checked = checked;
274     }
275
276     /**
277      * Returns the checkedWrapper.
278      * @return Boolean
279      */

280     public Boolean JavaDoc getCheckedWrapper() {
281         return checkedWrapper;
282     }
283
284     /**
285      * Sets the checkedWrapper.
286      * @param checkedWrapper The checkedWrapper to set
287      */

288     public void setCheckedWrapper(Boolean JavaDoc checkedWrapper) {
289         this.checkedWrapper = checkedWrapper;
290     }
291
292     /**
293      * Returns the x.
294      * @return String
295      */

296     public String JavaDoc getX() {
297         return x;
298     }
299
300     /**
301      * Returns the y.
302      * @return String
303      */

304     public String JavaDoc getY() {
305         return y;
306     }
307
308     /**
309      * Sets the x.
310      * @param x The x to set
311      */

312     public void setX(String JavaDoc x) {
313         this.x = x;
314     }
315
316     /**
317      * Sets the y.
318      * @param y The y to set
319      */

320     public void setY(String JavaDoc y) {
321         this.y = y;
322     }
323
324 }
325
Popular Tags