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