1
2
3
4
5
6
7
8 package org.exolab.castor.mapping.xml;
9
10
11
12
13
14
15
16
17
18
19
20 @SuppressWarnings("serial")
21 public class BindXml implements java.io.Serializable {
22
23
24
25
26
27
28
29
30
31
32
33
34 private java.lang.String _name;
35
36
37
38
39 private java.lang.String _type;
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54 private org.exolab.castor.mapping.xml.types.BindXmlAutoNamingType _autoNaming;
55
56
57
58
59
60
61
62 private java.lang.String _location;
63
64
65
66
67 private java.lang.String _matches;
68
69
70
71
72 private boolean _reference;
73
74
75
76
77 private boolean _has_reference;
78
79
80
81
82 private org.exolab.castor.mapping.xml.types.BindXmlNodeType _node;
83
84
85
86
87 private java.lang.String _QNamePrefix;
88
89
90
91
92 private boolean _transient;
93
94
95
96
97 private boolean _has_transient;
98
99
100
101
102
103
104 private org.exolab.castor.mapping.xml.ClassMapping _classMapping;
105
106
107
108
109 private java.util.List<org.exolab.castor.mapping.xml.Property> _propertyList;
110
111
112
113
114
115
116 public BindXml() {
117 super();
118 this._propertyList = new java.util.ArrayList<org.exolab.castor.mapping.xml.Property>();
119 }
120
121
122
123
124
125
126
127
128
129
130
131
132
133 public void addProperty(
134 final org.exolab.castor.mapping.xml.Property vProperty)
135 throws java.lang.IndexOutOfBoundsException {
136 this._propertyList.add(vProperty);
137 }
138
139
140
141
142
143
144
145
146
147 public void addProperty(
148 final int index,
149 final org.exolab.castor.mapping.xml.Property vProperty)
150 throws java.lang.IndexOutOfBoundsException {
151 this._propertyList.add(index, vProperty);
152 }
153
154
155
156 public void deleteReference(
157 ) {
158 this._has_reference= false;
159 }
160
161
162
163 public void deleteTransient(
164 ) {
165 this._has_transient= false;
166 }
167
168
169
170
171
172
173
174 public java.util.Enumeration<? extends org.exolab.castor.mapping.xml.Property> enumerateProperty(
175 ) {
176 return java.util.Collections.enumeration(this._propertyList);
177 }
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196 public org.exolab.castor.mapping.xml.types.BindXmlAutoNamingType getAutoNaming(
197 ) {
198 return this._autoNaming;
199 }
200
201
202
203
204
205
206
207
208
209
210 public org.exolab.castor.mapping.xml.ClassMapping getClassMapping(
211 ) {
212 return this._classMapping;
213 }
214
215
216
217
218
219
220
221
222
223
224
225 public java.lang.String getLocation(
226 ) {
227 return this._location;
228 }
229
230
231
232
233
234
235 public java.lang.String getMatches(
236 ) {
237 return this._matches;
238 }
239
240
241
242
243
244
245
246
247
248
249 public java.lang.String getName(
250 ) {
251 return this._name;
252 }
253
254
255
256
257
258
259 public org.exolab.castor.mapping.xml.types.BindXmlNodeType getNode(
260 ) {
261 return this._node;
262 }
263
264
265
266
267
268
269
270
271
272
273 public org.exolab.castor.mapping.xml.Property getProperty(
274 final int index)
275 throws java.lang.IndexOutOfBoundsException {
276
277 if (index < 0 || index >= this._propertyList.size()) {
278 throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
279 }
280
281 return (org.exolab.castor.mapping.xml.Property) _propertyList.get(index);
282 }
283
284
285
286
287
288
289
290
291
292
293 public org.exolab.castor.mapping.xml.Property[] getProperty(
294 ) {
295 org.exolab.castor.mapping.xml.Property[] array = new org.exolab.castor.mapping.xml.Property[0];
296 return (org.exolab.castor.mapping.xml.Property[]) this._propertyList.toArray(array);
297 }
298
299
300
301
302
303
304 public int getPropertyCount(
305 ) {
306 return this._propertyList.size();
307 }
308
309
310
311
312
313
314 public java.lang.String getQNamePrefix(
315 ) {
316 return this._QNamePrefix;
317 }
318
319
320
321
322
323
324 public boolean getReference(
325 ) {
326 return this._reference;
327 }
328
329
330
331
332
333
334 public boolean getTransient(
335 ) {
336 return this._transient;
337 }
338
339
340
341
342
343
344 public java.lang.String getType(
345 ) {
346 return this._type;
347 }
348
349
350
351
352
353
354 public boolean hasReference(
355 ) {
356 return this._has_reference;
357 }
358
359
360
361
362
363
364 public boolean hasTransient(
365 ) {
366 return this._has_transient;
367 }
368
369
370
371
372
373
374 public boolean isReference(
375 ) {
376 return this._reference;
377 }
378
379
380
381
382
383
384 public boolean isTransient(
385 ) {
386 return this._transient;
387 }
388
389
390
391
392
393
394 public boolean isValid(
395 ) {
396 try {
397 validate();
398 } catch (org.exolab.castor.xml.ValidationException vex) {
399 return false;
400 }
401 return true;
402 }
403
404
405
406
407
408
409
410 public java.util.Iterator<? extends org.exolab.castor.mapping.xml.Property> iterateProperty(
411 ) {
412 return this._propertyList.iterator();
413 }
414
415
416
417
418
419
420
421
422
423
424 public void marshal(
425 final java.io.Writer out)
426 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
427 org.exolab.castor.xml.Marshaller.marshal(this, out);
428 }
429
430
431
432
433
434
435
436
437
438
439
440
441 public void marshal(
442 final org.xml.sax.ContentHandler handler)
443 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
444 org.exolab.castor.xml.Marshaller.marshal(this, handler);
445 }
446
447
448
449 public void removeAllProperty(
450 ) {
451 this._propertyList.clear();
452 }
453
454
455
456
457
458
459
460 public boolean removeProperty(
461 final org.exolab.castor.mapping.xml.Property vProperty) {
462 boolean removed = _propertyList.remove(vProperty);
463 return removed;
464 }
465
466
467
468
469
470
471
472 public org.exolab.castor.mapping.xml.Property removePropertyAt(
473 final int index) {
474 java.lang.Object obj = this._propertyList.remove(index);
475 return (org.exolab.castor.mapping.xml.Property) obj;
476 }
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495 public void setAutoNaming(
496 final org.exolab.castor.mapping.xml.types.BindXmlAutoNamingType autoNaming) {
497 this._autoNaming = autoNaming;
498 }
499
500
501
502
503
504
505
506
507
508
509 public void setClassMapping(
510 final org.exolab.castor.mapping.xml.ClassMapping classMapping) {
511 this._classMapping = classMapping;
512 }
513
514
515
516
517
518
519
520
521
522
523
524 public void setLocation(
525 final java.lang.String location) {
526 this._location = location;
527 }
528
529
530
531
532
533
534 public void setMatches(
535 final java.lang.String matches) {
536 this._matches = matches;
537 }
538
539
540
541
542
543
544
545
546
547
548 public void setName(
549 final java.lang.String name) {
550 this._name = name;
551 }
552
553
554
555
556
557
558 public void setNode(
559 final org.exolab.castor.mapping.xml.types.BindXmlNodeType node) {
560 this._node = node;
561 }
562
563
564
565
566
567
568
569
570
571 public void setProperty(
572 final int index,
573 final org.exolab.castor.mapping.xml.Property vProperty)
574 throws java.lang.IndexOutOfBoundsException {
575
576 if (index < 0 || index >= this._propertyList.size()) {
577 throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]");
578 }
579
580 this._propertyList.set(index, vProperty);
581 }
582
583
584
585
586
587
588 public void setProperty(
589 final org.exolab.castor.mapping.xml.Property[] vPropertyArray) {
590
591 _propertyList.clear();
592
593 for (int i = 0; i < vPropertyArray.length; i++) {
594 this._propertyList.add(vPropertyArray[i]);
595 }
596 }
597
598
599
600
601
602
603 public void setQNamePrefix(
604 final java.lang.String QNamePrefix) {
605 this._QNamePrefix = QNamePrefix;
606 }
607
608
609
610
611
612
613 public void setReference(
614 final boolean reference) {
615 this._reference = reference;
616 this._has_reference = true;
617 }
618
619
620
621
622
623
624
625 public void setTransient(
626 final boolean _transient) {
627 this._transient = _transient;
628 this._has_transient = true;
629 }
630
631
632
633
634
635
636 public void setType(
637 final java.lang.String type) {
638 this._type = type;
639 }
640
641
642
643
644
645
646
647
648
649
650
651 public static org.exolab.castor.mapping.xml.BindXml unmarshal(
652 final java.io.Reader reader)
653 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
654 return (org.exolab.castor.mapping.xml.BindXml) org.exolab.castor.xml.Unmarshaller.unmarshal(org.exolab.castor.mapping.xml.BindXml.class, reader);
655 }
656
657
658
659
660
661
662
663 public void validate(
664 )
665 throws org.exolab.castor.xml.ValidationException {
666 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
667 validator.validate(this);
668 }
669
670 }