1
2
3
4
5
6
7
8
9 package org.jomc.modlet;
10
11 import java.io.ByteArrayInputStream;
12 import java.io.ByteArrayOutputStream;
13 import java.io.File;
14 import java.io.IOException;
15 import java.io.InvalidClassException;
16 import java.io.NotSerializableException;
17 import java.io.ObjectInputStream;
18 import java.io.ObjectOutputStream;
19 import java.io.OptionalDataException;
20 import java.io.Serializable;
21 import java.io.StreamCorruptedException;
22 import java.lang.reflect.Array;
23 import java.lang.reflect.InvocationTargetException;
24 import java.math.BigDecimal;
25 import java.math.BigInteger;
26 import java.net.MalformedURLException;
27 import java.net.URI;
28 import java.net.URISyntaxException;
29 import java.net.URL;
30 import java.util.ArrayList;
31 import java.util.Calendar;
32 import java.util.Currency;
33 import java.util.Date;
34 import java.util.Iterator;
35 import java.util.List;
36 import java.util.Locale;
37 import java.util.TimeZone;
38 import java.util.UUID;
39 import javax.activation.MimeType;
40 import javax.activation.MimeTypeParseException;
41 import javax.annotation.Generated;
42 import javax.xml.bind.JAXBElement;
43 import javax.xml.bind.annotation.XmlAccessType;
44 import javax.xml.bind.annotation.XmlAccessorType;
45 import javax.xml.bind.annotation.XmlAnyElement;
46 import javax.xml.bind.annotation.XmlAttribute;
47 import javax.xml.bind.annotation.XmlType;
48 import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
49 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
50 import javax.xml.datatype.Duration;
51 import javax.xml.datatype.XMLGregorianCalendar;
52 import javax.xml.namespace.QName;
53 import org.w3c.dom.Element;
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88 @XmlAccessorType(XmlAccessType.FIELD)
89 @XmlType(name = "Schema", namespace = "http://jomc.org/modlet", propOrder = {
90 "any"
91 })
92 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
93 public class Schema
94 extends ModletObject
95 implements Cloneable
96 {
97
98 @XmlAnyElement(lax = true)
99 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
100 protected List<Object> any;
101 @XmlAttribute(name = "public-id", required = true)
102 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
103 protected String publicId;
104 @XmlAttribute(name = "system-id", required = true)
105 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
106 protected String systemId;
107 @XmlAttribute(name = "context-id")
108 @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
109 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
110 protected String contextId;
111 @XmlAttribute(name = "classpath-id")
112 @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
113 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
114 protected String classpathId;
115
116
117
118
119
120 public Schema() {
121
122 super();
123 }
124
125
126
127
128
129
130
131
132
133
134 public Schema(final Schema o) {
135
136 super(o);
137 if (o == null) {
138 throw new NullPointerException("Cannot create a copy of 'Schema' from 'null'.");
139 }
140
141 if (o.any!= null) {
142 copyAny(o.getAny(), this.getAny());
143 }
144
145 this.publicId = ((o.publicId == null)?null:o.getPublicId());
146
147 this.systemId = ((o.systemId == null)?null:o.getSystemId());
148
149 this.contextId = ((o.contextId == null)?null:o.getContextId());
150
151 this.classpathId = ((o.classpathId == null)?null:o.getClasspathId());
152 }
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
178 public List<Object> getAny() {
179 if (any == null) {
180 any = new ArrayList<Object>();
181 }
182 return this.any;
183 }
184
185
186
187
188
189
190
191
192
193 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
194 public String getPublicId() {
195 return publicId;
196 }
197
198
199
200
201
202
203
204
205
206 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
207 public void setPublicId(String value) {
208 this.publicId = value;
209 }
210
211
212
213
214
215
216
217
218
219 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
220 public String getSystemId() {
221 return systemId;
222 }
223
224
225
226
227
228
229
230
231
232 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
233 public void setSystemId(String value) {
234 this.systemId = value;
235 }
236
237
238
239
240
241
242
243
244
245 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
246 public String getContextId() {
247 return contextId;
248 }
249
250
251
252
253
254
255
256
257
258 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
259 public void setContextId(String value) {
260 this.contextId = value;
261 }
262
263
264
265
266
267
268
269
270
271 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
272 public String getClasspathId() {
273 return classpathId;
274 }
275
276
277
278
279
280
281
282
283
284 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
285 public void setClasspathId(String value) {
286 this.classpathId = value;
287 }
288
289
290
291
292
293
294
295
296
297
298
299 @SuppressWarnings("unchecked")
300 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
301 private static void copyAny(final List<Object> source, final List<Object> target) {
302
303 if ((source!= null)&&(!source.isEmpty())) {
304 for (final Iterator<?> it = source.iterator(); it.hasNext(); ) {
305 final Object next = it.next();
306 if (next instanceof Element) {
307
308 target.add(((Element)((Element) next).cloneNode(true)));
309 continue;
310 }
311 if (next instanceof Object) {
312
313 target.add(copyOf(((Object) next)));
314 continue;
315 }
316
317 throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Any' of class 'org.jomc.modlet.Schema'."));
318 }
319 }
320 }
321
322
323
324
325
326
327
328
329
330 @SuppressWarnings("unchecked")
331 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
332 private static Object copyOf(final Object o) {
333
334 try {
335 if (o!= null) {
336 if (o.getClass().isPrimitive()) {
337 return o;
338 }
339 if (o.getClass().isArray()) {
340 return copyOfArray(o);
341 }
342
343 if (o instanceof Boolean) {
344 return o;
345 }
346 if (o instanceof Byte) {
347 return o;
348 }
349 if (o instanceof Character) {
350 return o;
351 }
352 if (o instanceof Double) {
353 return o;
354 }
355 if (o instanceof Enum) {
356 return o;
357 }
358 if (o instanceof Float) {
359 return o;
360 }
361 if (o instanceof Integer) {
362 return o;
363 }
364 if (o instanceof Long) {
365 return o;
366 }
367 if (o instanceof Short) {
368 return o;
369 }
370 if (o instanceof String) {
371 return o;
372 }
373 if (o instanceof BigDecimal) {
374 return o;
375 }
376 if (o instanceof BigInteger) {
377 return o;
378 }
379 if (o instanceof UUID) {
380 return o;
381 }
382 if (o instanceof QName) {
383 return o;
384 }
385 if (o instanceof Duration) {
386 return o;
387 }
388 if (o instanceof Currency) {
389 return o;
390 }
391
392 if (o instanceof File) {
393 return new File(o.toString());
394 }
395 if (o instanceof URI) {
396 return new URI(o.toString());
397 }
398 if (o instanceof URL) {
399 return new URL(o.toString());
400 }
401 if (o instanceof MimeType) {
402 return new MimeType(o.toString());
403 }
404
405 if (o instanceof XMLGregorianCalendar) {
406 return ((XMLGregorianCalendar) o).clone();
407 }
408 if (o instanceof Date) {
409 return ((Date) o).clone();
410 }
411 if (o instanceof Calendar) {
412 return ((Calendar) o).clone();
413 }
414 if (o instanceof TimeZone) {
415 return ((TimeZone) o).clone();
416 }
417 if (o instanceof Locale) {
418 return ((Locale) o).clone();
419 }
420 if (o instanceof Element) {
421 return ((Element)((Element) o).cloneNode(true));
422 }
423 if (o instanceof JAXBElement) {
424 return copyOf(((JAXBElement) o));
425 }
426 try {
427 return o.getClass().getMethod("clone", ((Class[]) null)).invoke(o, ((Object[]) null));
428 } catch (NoSuchMethodException e) {
429 if (o instanceof Serializable) {
430 return copyOf(((Serializable) o));
431 }
432
433 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
434 } catch (IllegalAccessException e) {
435
436 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
437 } catch (InvocationTargetException e) {
438
439 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
440 } catch (SecurityException e) {
441
442 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
443 } catch (IllegalArgumentException e) {
444
445 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
446 } catch (ExceptionInInitializerError e) {
447
448 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
449 }
450 }
451 return null;
452 } catch (MalformedURLException e) {
453 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
454 } catch (URISyntaxException e) {
455 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
456 } catch (MimeTypeParseException e) {
457 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
458 }
459 }
460
461
462
463
464
465
466
467
468
469 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
470 private static Object copyOfArray(final Object array) {
471
472 if (array!= null) {
473 if (array.getClass() == boolean[].class) {
474 return copyOf(((boolean[]) array));
475 }
476 if (array.getClass() == byte[].class) {
477 return copyOf(((byte[]) array));
478 }
479 if (array.getClass() == char[].class) {
480 return copyOf(((char[]) array));
481 }
482 if (array.getClass() == double[].class) {
483 return copyOf(((double[]) array));
484 }
485 if (array.getClass() == float[].class) {
486 return copyOf(((float[]) array));
487 }
488 if (array.getClass() == int[].class) {
489 return copyOf(((int[]) array));
490 }
491 if (array.getClass() == long[].class) {
492 return copyOf(((long[]) array));
493 }
494 if (array.getClass() == short[].class) {
495 return copyOf(((short[]) array));
496 }
497 final int len = Array.getLength(array);
498 final Object copy = Array.newInstance(array.getClass().getComponentType(), len);
499 for (int i = (len- 1); (i >= 0); i--) {
500 Array.set(copy, i, copyOf(Array.get(array, i)));
501 }
502 return copy;
503 }
504 return null;
505 }
506
507
508
509
510
511
512
513
514
515 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
516 private static boolean[] copyOf(final boolean[] array) {
517
518 if (array!= null) {
519 final boolean[] copy = ((boolean[]) Array.newInstance(array.getClass().getComponentType(), array.length));
520 System.arraycopy(array, 0, copy, 0, array.length);
521 return copy;
522 }
523 return null;
524 }
525
526
527
528
529
530
531
532
533
534 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
535 private static byte[] copyOf(final byte[] array) {
536
537 if (array!= null) {
538 final byte[] copy = ((byte[]) Array.newInstance(array.getClass().getComponentType(), array.length));
539 System.arraycopy(array, 0, copy, 0, array.length);
540 return copy;
541 }
542 return null;
543 }
544
545
546
547
548
549
550
551
552
553 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
554 private static char[] copyOf(final char[] array) {
555
556 if (array!= null) {
557 final char[] copy = ((char[]) Array.newInstance(array.getClass().getComponentType(), array.length));
558 System.arraycopy(array, 0, copy, 0, array.length);
559 return copy;
560 }
561 return null;
562 }
563
564
565
566
567
568
569
570
571
572 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
573 private static double[] copyOf(final double[] array) {
574
575 if (array!= null) {
576 final double[] copy = ((double[]) Array.newInstance(array.getClass().getComponentType(), array.length));
577 System.arraycopy(array, 0, copy, 0, array.length);
578 return copy;
579 }
580 return null;
581 }
582
583
584
585
586
587
588
589
590
591 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
592 private static float[] copyOf(final float[] array) {
593
594 if (array!= null) {
595 final float[] copy = ((float[]) Array.newInstance(array.getClass().getComponentType(), array.length));
596 System.arraycopy(array, 0, copy, 0, array.length);
597 return copy;
598 }
599 return null;
600 }
601
602
603
604
605
606
607
608
609
610 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
611 private static int[] copyOf(final int[] array) {
612
613 if (array!= null) {
614 final int[] copy = ((int[]) Array.newInstance(array.getClass().getComponentType(), array.length));
615 System.arraycopy(array, 0, copy, 0, array.length);
616 return copy;
617 }
618 return null;
619 }
620
621
622
623
624
625
626
627
628
629 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
630 private static long[] copyOf(final long[] array) {
631
632 if (array!= null) {
633 final long[] copy = ((long[]) Array.newInstance(array.getClass().getComponentType(), array.length));
634 System.arraycopy(array, 0, copy, 0, array.length);
635 return copy;
636 }
637 return null;
638 }
639
640
641
642
643
644
645
646
647
648 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
649 private static short[] copyOf(final short[] array) {
650
651 if (array!= null) {
652 final short[] copy = ((short[]) Array.newInstance(array.getClass().getComponentType(), array.length));
653 System.arraycopy(array, 0, copy, 0, array.length);
654 return copy;
655 }
656 return null;
657 }
658
659
660
661
662
663
664
665
666
667 @SuppressWarnings("unchecked")
668 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
669 private static JAXBElement copyOf(final JAXBElement element) {
670
671 if (element!= null) {
672 final JAXBElement copy = new JAXBElement(element.getName(), element.getDeclaredType(), element.getScope(), element.getValue());
673 copy.setNil(element.isNil());
674 copy.setValue(copyOf(copy.getValue()));
675 return copy;
676 }
677 return null;
678 }
679
680
681
682
683
684
685
686
687
688 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
689 private static Serializable copyOf(final Serializable serializable) {
690
691 if (serializable!= null) {
692 try {
693 final ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream();
694 final ObjectOutputStream out = new ObjectOutputStream(byteArrayOutput);
695 out.writeObject(serializable);
696 out.close();
697 final ByteArrayInputStream byteArrayInput = new ByteArrayInputStream(byteArrayOutput.toByteArray());
698 final ObjectInputStream in = new ObjectInputStream(byteArrayInput);
699 final Serializable copy = ((Serializable) in.readObject());
700 in.close();
701 return copy;
702 } catch (SecurityException e) {
703 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
704 } catch (ClassNotFoundException e) {
705 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
706 } catch (InvalidClassException e) {
707 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
708 } catch (NotSerializableException e) {
709 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
710 } catch (StreamCorruptedException e) {
711 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
712 } catch (OptionalDataException e) {
713 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
714 } catch (IOException e) {
715 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
716 }
717 }
718 return null;
719 }
720
721
722
723
724
725
726
727
728 @Override
729 @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-11-18T06:51:51+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
730 public Schema clone() {
731 {
732
733 final Schema clone = ((Schema) super.clone());
734
735 if (this.any!= null) {
736 clone.any = null;
737 copyAny(this.getAny(), clone.getAny());
738 }
739
740 clone.publicId = ((this.publicId == null)?null:this.getPublicId());
741
742 clone.systemId = ((this.systemId == null)?null:this.getSystemId());
743
744 clone.contextId = ((this.contextId == null)?null:this.getContextId());
745
746 clone.classpathId = ((this.classpathId == null)?null:this.getClasspathId());
747 return clone;
748 }
749 }
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769 @Deprecated
770 public javax.xml.bind.JAXBElement getAnyElement( final String namespaceURI, final String localPart )
771 {
772 return this.getAnyElement( this.getAny(), namespaceURI, localPart );
773 }
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792 @Deprecated
793 public java.util.List<javax.xml.bind.JAXBElement> getAnyElements( final String namespaceURI,
794 final String localPart )
795 {
796 return this.getAnyElements( this.getAny(), namespaceURI, localPart );
797 }
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818 public <T> javax.xml.bind.JAXBElement<T> getAnyElement( final String namespaceURI, final String localPart,
819 final Class<T> type )
820 {
821 return this.getAnyElement( this.getAny(), namespaceURI, localPart, type );
822 }
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842 public <T> java.util.List<javax.xml.bind.JAXBElement<T>> getAnyElements( final String namespaceURI,
843 final String localPart,
844 final Class<T> type )
845 {
846 return this.getAnyElements( this.getAny(), namespaceURI, localPart, type );
847 }
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863 public <T> T getAnyObject( final Class<T> clazz )
864 {
865 return this.getAnyObject( this.getAny(), clazz );
866 }
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881 public <T> java.util.List<T> getAnyObjects( final Class<T> clazz )
882 {
883 return this.getAnyObjects( this.getAny(), clazz );
884 }
885
886
887
888
889
890
891
892
893
894 @Deprecated
895 public java.net.URI getPublicIdUri()
896 {
897 java.net.URI uri = null;
898
899 if ( this.getPublicId() != null )
900 {
901 try
902 {
903 uri = new java.net.URI( this.getPublicId() );
904 }
905 catch ( final java.net.URISyntaxException e )
906 {
907 throw new AssertionError( e );
908 }
909 }
910
911 return uri;
912 }
913
914
915
916
917
918
919
920
921
922 @Deprecated
923 public java.net.URI getSystemIdUri()
924 {
925 java.net.URI uri = null;
926
927 if ( this.getSystemId() != null )
928 {
929 try
930 {
931 uri = new java.net.URI( this.getSystemId() );
932 }
933 catch ( final java.net.URISyntaxException e )
934 {
935 throw new AssertionError( e );
936 }
937 }
938
939 return uri;
940 }
941
942 }