1
2
3
4
5
6
7
8 package org.exolab.castor.tests.framework.testDescriptor;
9
10
11
12
13
14
15
16 public class CallMethod implements java.io.Serializable {
17
18
19
20
21
22
23
24
25
26 private java.lang.String _name;
27
28
29
30
31
32 private java.util.List _valueList;
33
34
35
36
37
38
39 public CallMethod() {
40 super();
41 this._valueList = new java.util.ArrayList();
42 }
43
44
45
46
47
48
49
50
51
52
53
54
55
56 public void addValue(
57 final org.exolab.castor.tests.framework.testDescriptor.Value vValue)
58 throws java.lang.IndexOutOfBoundsException {
59 this._valueList.add(vValue);
60 }
61
62
63
64
65
66
67
68
69
70 public void addValue(
71 final int index,
72 final org.exolab.castor.tests.framework.testDescriptor.Value vValue)
73 throws java.lang.IndexOutOfBoundsException {
74 this._valueList.add(index, vValue);
75 }
76
77
78
79
80
81
82
83 public java.util.Enumeration enumerateValue(
84 ) {
85 return java.util.Collections.enumeration(this._valueList);
86 }
87
88
89
90
91
92
93 public java.lang.String getName(
94 ) {
95 return this._name;
96 }
97
98
99
100
101
102
103
104
105
106
107
108 public org.exolab.castor.tests.framework.testDescriptor.Value getValue(
109 final int index)
110 throws java.lang.IndexOutOfBoundsException {
111
112 if (index < 0 || index >= this._valueList.size()) {
113 throw new IndexOutOfBoundsException("getValue: Index value '" + index + "' not in range [0.." + (this._valueList.size() - 1) + "]");
114 }
115
116 return (org.exolab.castor.tests.framework.testDescriptor.Value) _valueList.get(index);
117 }
118
119
120
121
122
123
124
125
126
127
128 public org.exolab.castor.tests.framework.testDescriptor.Value[] getValue(
129 ) {
130 org.exolab.castor.tests.framework.testDescriptor.Value[] array = new org.exolab.castor.tests.framework.testDescriptor.Value[0];
131 return (org.exolab.castor.tests.framework.testDescriptor.Value[]) this._valueList.toArray(array);
132 }
133
134
135
136
137
138
139 public int getValueCount(
140 ) {
141 return this._valueList.size();
142 }
143
144
145
146
147
148
149 public boolean isValid(
150 ) {
151 try {
152 validate();
153 } catch (org.exolab.castor.xml.ValidationException vex) {
154 return false;
155 }
156 return true;
157 }
158
159
160
161
162
163
164
165 public java.util.Iterator iterateValue(
166 ) {
167 return this._valueList.iterator();
168 }
169
170
171
172
173
174
175
176
177
178
179 public void marshal(
180 final java.io.Writer out)
181 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
182 org.exolab.castor.xml.Marshaller.marshal(this, out);
183 }
184
185
186
187
188
189
190
191
192
193
194
195
196 public void marshal(
197 final org.xml.sax.ContentHandler handler)
198 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
199 org.exolab.castor.xml.Marshaller.marshal(this, handler);
200 }
201
202
203
204 public void removeAllValue(
205 ) {
206 this._valueList.clear();
207 }
208
209
210
211
212
213
214
215 public boolean removeValue(
216 final org.exolab.castor.tests.framework.testDescriptor.Value vValue) {
217 boolean removed = _valueList.remove(vValue);
218 return removed;
219 }
220
221
222
223
224
225
226
227 public org.exolab.castor.tests.framework.testDescriptor.Value removeValueAt(
228 final int index) {
229 java.lang.Object obj = this._valueList.remove(index);
230 return (org.exolab.castor.tests.framework.testDescriptor.Value) obj;
231 }
232
233
234
235
236
237
238 public void setName(
239 final java.lang.String name) {
240 this._name = name;
241 }
242
243
244
245
246
247
248
249
250
251 public void setValue(
252 final int index,
253 final org.exolab.castor.tests.framework.testDescriptor.Value vValue)
254 throws java.lang.IndexOutOfBoundsException {
255
256 if (index < 0 || index >= this._valueList.size()) {
257 throw new IndexOutOfBoundsException("setValue: Index value '" + index + "' not in range [0.." + (this._valueList.size() - 1) + "]");
258 }
259
260 this._valueList.set(index, vValue);
261 }
262
263
264
265
266
267
268 public void setValue(
269 final org.exolab.castor.tests.framework.testDescriptor.Value[] vValueArray) {
270
271 _valueList.clear();
272
273 for (int i = 0; i < vValueArray.length; i++) {
274 this._valueList.add(vValueArray[i]);
275 }
276 }
277
278
279
280
281
282
283
284
285
286
287
288
289 public static org.exolab.castor.tests.framework.testDescriptor.CallMethod unmarshal(
290 final java.io.Reader reader)
291 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
292 return (org.exolab.castor.tests.framework.testDescriptor.CallMethod) org.exolab.castor.xml.Unmarshaller.unmarshal(org.exolab.castor.tests.framework.testDescriptor.CallMethod.class, reader);
293 }
294
295
296
297
298
299
300
301 public void validate(
302 )
303 throws org.exolab.castor.xml.ValidationException {
304 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
305 validator.validate(this);
306 }
307
308 }