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 Attribute implements java.io.Serializable {
32
33
34
35
36
37
38
39
40
41 private java.lang.String _name;
42
43
44
45
46 private java.lang.String _value;
47
48
49
50
51 private java.util.ArrayList _itemList;
52
53
54
55
56
57
58 public Attribute()
59 {
60 super();
61 _itemList = new ArrayList();
62 }
63
64
65
66
67
68
69
70
71
72
73
74
75
76 public void addItem(java.lang.String vItem)
77 throws java.lang.IndexOutOfBoundsException
78 {
79 _itemList.add(vItem);
80 }
81
82
83
84
85
86
87
88
89
90 public void addItem(int index, java.lang.String vItem)
91 throws java.lang.IndexOutOfBoundsException
92 {
93 _itemList.add(index, vItem);
94 }
95
96
97
98
99
100 public void clearItem()
101 {
102 _itemList.clear();
103 }
104
105
106
107
108
109
110
111
112 public java.util.Enumeration enumerateItem()
113 {
114 return new org.exolab.castor.util.IteratorEnumeration(_itemList.iterator());
115 }
116
117
118
119
120
121
122
123
124
125 public java.lang.String getItem(int index)
126 throws java.lang.IndexOutOfBoundsException
127 {
128
129 if ((index < 0) || (index > _itemList.size())) {
130 throw new IndexOutOfBoundsException();
131 }
132
133 return (String)_itemList.get(index);
134 }
135
136
137
138
139
140
141
142
143 public java.lang.String[] getItem()
144 {
145 int size = _itemList.size();
146 java.lang.String[] mArray = new java.lang.String[size];
147 for (int index = 0; index < size; index++) {
148 mArray[index] = (String)_itemList.get(index);
149 }
150 return mArray;
151 }
152
153
154
155
156
157
158
159
160 public int getItemCount()
161 {
162 return _itemList.size();
163 }
164
165
166
167
168
169
170
171 public java.lang.String getName()
172 {
173 return this._name;
174 }
175
176
177
178
179
180
181
182 public java.lang.String getValue()
183 {
184 return this._value;
185 }
186
187
188
189
190
191
192
193
194 public boolean isValid()
195 {
196 try {
197 validate();
198 }
199 catch (org.exolab.castor.xml.ValidationException vex) {
200 return false;
201 }
202 return true;
203 }
204
205
206
207
208
209
210
211
212 public void marshal(java.io.Writer out)
213 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
214 {
215
216 Marshaller.marshal(this, out);
217 }
218
219
220
221
222
223
224
225
226 public void marshal(org.xml.sax.ContentHandler handler)
227 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
228 {
229
230 Marshaller.marshal(this, handler);
231 }
232
233
234
235
236
237
238
239
240
241 public boolean removeItem(java.lang.String vItem)
242 {
243 boolean removed = _itemList.remove(vItem);
244 return removed;
245 }
246
247
248
249
250
251
252
253
254
255 public void setItem(int index, java.lang.String vItem)
256 throws java.lang.IndexOutOfBoundsException
257 {
258
259 if ((index < 0) || (index > _itemList.size())) {
260 throw new IndexOutOfBoundsException();
261 }
262 _itemList.set(index, vItem);
263 }
264
265
266
267
268
269
270
271
272 public void setItem(java.lang.String[] itemArray)
273 {
274
275 _itemList.clear();
276 for (int i = 0; i < itemArray.length; i++) {
277 _itemList.add(itemArray[i]);
278 }
279 }
280
281
282
283
284
285
286 public void setName(java.lang.String name)
287 {
288 this._name = name;
289 }
290
291
292
293
294
295
296 public void setValue(java.lang.String value)
297 {
298 this._value = value;
299 }
300
301
302
303
304
305
306
307
308
309 public static java.lang.Object unmarshal(java.io.Reader reader)
310 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
311 {
312 return (fr.in2p3.jsaga.generated.session.Attribute) Unmarshaller.unmarshal(fr.in2p3.jsaga.generated.session.Attribute.class, reader);
313 }
314
315
316
317
318
319 public void validate()
320 throws org.exolab.castor.xml.ValidationException
321 {
322 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
323 validator.validate(this);
324 }
325
326 }