1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.commons.digester3;
20
21 import org.apache.commons.digester3.annotations.rules.CallParam;
22 import org.apache.commons.digester3.annotations.rules.ObjectCreate;
23
24
25
26
27
28
29 public class TestBean
30 {
31
32 public TestBean()
33 {
34
35 }
36
37 @ObjectCreate( pattern = "toplevel/bean" )
38 public TestBean( @CallParam( pattern = "toplevel/bean", attributeName = "boolean" ) boolean booleanProperty,
39 @CallParam( pattern = "toplevel/bean", attributeName = "double" ) double doubleProperty )
40 {
41 setBooleanProperty( booleanProperty );
42 setDoubleProperty( doubleProperty );
43 }
44
45
46
47
48
49
50
51 public TestBean( Boolean booleanProperty, Double doubleProperty )
52 {
53 this( booleanProperty.booleanValue(), doubleProperty.doubleValue() );
54 }
55
56
57
58
59
60
61 private boolean booleanProperty = true;
62
63 public boolean getBooleanProperty()
64 {
65 return ( booleanProperty );
66 }
67
68 public void setBooleanProperty( boolean booleanProperty )
69 {
70 this.booleanProperty = booleanProperty;
71 }
72
73
74
75
76 private double doubleProperty = 321.0;
77
78 public double getDoubleProperty()
79 {
80 return ( this.doubleProperty );
81 }
82
83 public void setDoubleProperty( double doubleProperty )
84 {
85 this.doubleProperty = doubleProperty;
86 }
87
88
89
90
91 private boolean falseProperty = false;
92
93 public boolean getFalseProperty()
94 {
95 return ( falseProperty );
96 }
97
98 public void setFalseProperty( boolean falseProperty )
99 {
100 this.falseProperty = falseProperty;
101 }
102
103
104
105
106 private float floatProperty = (float) 123.0;
107
108 public float getFloatProperty()
109 {
110 return ( this.floatProperty );
111 }
112
113 public void setFloatProperty( float floatProperty )
114 {
115 this.floatProperty = floatProperty;
116 }
117
118
119
120
121 private int intArray[] = { 0, 10, 20, 30, 40 };
122
123 public int[] getIntArray()
124 {
125 return ( this.intArray );
126 }
127
128 public void setIntArray( int intArray[] )
129 {
130 this.intArray = intArray;
131 }
132
133 private int intIndexed[] = { 0, 10, 20, 30, 40 };
134
135 public int getIntIndexed( int index )
136 {
137 return ( intIndexed[index] );
138 }
139
140 public void setIntIndexed( int index, int value )
141 {
142 intIndexed[index] = value;
143 }
144
145 private int intMultibox[] = new int[0];
146
147 public int[] getIntMultibox()
148 {
149 return ( this.intMultibox );
150 }
151
152 public void setIntMultibox( int intMultibox[] )
153 {
154 this.intMultibox = intMultibox;
155 }
156
157
158
159
160 private int intProperty = 123;
161
162 public int getIntProperty()
163 {
164 return ( this.intProperty );
165 }
166
167 public void setIntProperty( int intProperty )
168 {
169 this.intProperty = intProperty;
170 }
171
172
173
174
175 private long longProperty = 321;
176
177 public long getLongProperty()
178 {
179 return ( this.longProperty );
180 }
181
182 public void setLongProperty( long longProperty )
183 {
184 this.longProperty = longProperty;
185 }
186
187
188
189
190 private String[] multipleSelect = { "Multiple 3", "Multiple 5", "Multiple 7" };
191
192 public String[] getMultipleSelect()
193 {
194 return ( this.multipleSelect );
195 }
196
197 public void setMultipleSelect( String multipleSelect[] )
198 {
199 this.multipleSelect = multipleSelect;
200 }
201
202
203
204
205 private TestBean nested = null;
206
207 public TestBean getNested()
208 {
209 if ( nested == null )
210 nested = new TestBean();
211 return ( nested );
212 }
213
214
215
216
217 private String nullProperty = null;
218
219 public String getNullProperty()
220 {
221 return ( this.nullProperty );
222 }
223
224 public void setNullProperty( String nullProperty )
225 {
226 this.nullProperty = nullProperty;
227 }
228
229
230
231
232 private short shortProperty = (short) 987;
233
234 public short getShortProperty()
235 {
236 return ( this.shortProperty );
237 }
238
239 public void setShortProperty( short shortProperty )
240 {
241 this.shortProperty = shortProperty;
242 }
243
244
245
246
247 private String singleSelect = "Single 5";
248
249 public String getSingleSelect()
250 {
251 return ( this.singleSelect );
252 }
253
254 public void setSingleSelect( String singleSelect )
255 {
256 this.singleSelect = singleSelect;
257 }
258
259
260
261
262 private String stringArray[] = { "String 0", "String 1", "String 2", "String 3", "String 4" };
263
264 public String[] getStringArray()
265 {
266 return ( this.stringArray );
267 }
268
269 public void setStringArray( String stringArray[] )
270 {
271 this.stringArray = stringArray;
272 }
273
274 private String stringIndexed[] = { "String 0", "String 1", "String 2", "String 3", "String 4" };
275
276 public String getStringIndexed( int index )
277 {
278 return ( stringIndexed[index] );
279 }
280
281 public void setStringIndexed( int index, String value )
282 {
283 stringIndexed[index] = value;
284 }
285
286
287
288
289 private String stringProperty = "This is a string";
290
291 public String getStringProperty()
292 {
293 return ( this.stringProperty );
294 }
295
296 public void setStringProperty( String stringProperty )
297 {
298 this.stringProperty = stringProperty;
299 }
300
301
302
303
304 private String emptyStringProperty = "";
305
306 public String getEmptyStringProperty()
307 {
308 return ( this.emptyStringProperty );
309 }
310
311 public void setEmptyStringProperty( String emptyStringProperty )
312 {
313 this.emptyStringProperty = emptyStringProperty;
314 }
315
316 }