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