1
2
3
4
5
6
7
8
9 package org.jomc.model;
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.XmlElement;
48 import javax.xml.bind.annotation.XmlType;
49 import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
50 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
51 import javax.xml.datatype.Duration;
52 import javax.xml.datatype.XMLGregorianCalendar;
53 import javax.xml.namespace.QName;
54 import org.w3c.dom.Element;
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
89
90
91
92
93
94
95
96
97 @XmlAccessorType(XmlAccessType.FIELD)
98 @XmlType(name = "Instance", namespace = "http://jomc.org/model", propOrder = {
99 "specifications",
100 "dependencies",
101 "properties",
102 "messages",
103 "any"
104 })
105 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
106 public class Instance
107 extends ModelObject
108 implements Cloneable
109 {
110
111 @XmlElement(namespace = "http://jomc.org/model")
112 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
113 protected Specifications specifications;
114 @XmlElement(namespace = "http://jomc.org/model")
115 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
116 protected Dependencies dependencies;
117 @XmlElement(namespace = "http://jomc.org/model")
118 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
119 protected Properties properties;
120 @XmlElement(namespace = "http://jomc.org/model")
121 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
122 protected Messages messages;
123 @XmlAnyElement(lax = true)
124 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
125 protected List<Object> any;
126 @XmlAttribute(name = "identifier", required = true)
127 @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
128 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
129 protected String identifier;
130 @XmlAttribute(name = "name", required = true)
131 @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
132 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
133 protected String name;
134 @XmlAttribute(name = "class", required = true)
135 @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
136 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
137 protected String clazz;
138 @XmlAttribute(name = "stateless")
139 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
140 protected Boolean stateless;
141
142
143
144
145
146 public Instance() {
147
148 super();
149 }
150
151
152
153
154
155
156
157
158
159
160 public Instance(final Instance o) {
161
162 super(o);
163 if (o == null) {
164 throw new NullPointerException("Cannot create a copy of 'Instance' from 'null'.");
165 }
166
167 this.specifications = ((o.specifications == null)?null:((o.getSpecifications() == null)?null:o.getSpecifications().clone()));
168
169 this.dependencies = ((o.dependencies == null)?null:((o.getDependencies() == null)?null:o.getDependencies().clone()));
170
171 this.properties = ((o.properties == null)?null:((o.getProperties() == null)?null:o.getProperties().clone()));
172
173 this.messages = ((o.messages == null)?null:((o.getMessages() == null)?null:o.getMessages().clone()));
174
175 if (o.any!= null) {
176 copyAny(o.getAny(), this.getAny());
177 }
178
179 this.identifier = ((o.identifier == null)?null:o.getIdentifier());
180
181 this.name = ((o.name == null)?null:o.getName());
182
183 this.clazz = ((o.clazz == null)?null:o.getClazz());
184
185 this.stateless = ((o.stateless == null)?null:o.isStateless());
186 }
187
188
189
190
191
192
193
194
195
196 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
197 public Specifications getSpecifications() {
198 return specifications;
199 }
200
201
202
203
204
205
206
207
208
209 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
210 public void setSpecifications(Specifications value) {
211 this.specifications = value;
212 }
213
214
215
216
217
218
219
220
221
222 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
223 public Dependencies getDependencies() {
224 return dependencies;
225 }
226
227
228
229
230
231
232
233
234
235 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
236 public void setDependencies(Dependencies value) {
237 this.dependencies = value;
238 }
239
240
241
242
243
244
245
246
247
248 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
249 public Properties getProperties() {
250 return properties;
251 }
252
253
254
255
256
257
258
259
260
261 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
262 public void setProperties(Properties value) {
263 this.properties = value;
264 }
265
266
267
268
269
270
271
272
273
274 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
275 public Messages getMessages() {
276 return messages;
277 }
278
279
280
281
282
283
284
285
286
287 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
288 public void setMessages(Messages value) {
289 this.messages = value;
290 }
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
316 public List<Object> getAny() {
317 if (any == null) {
318 any = new ArrayList<Object>();
319 }
320 return this.any;
321 }
322
323
324
325
326
327
328
329
330
331 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
332 public String getIdentifier() {
333 return identifier;
334 }
335
336
337
338
339
340
341
342
343
344 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
345 public void setIdentifier(String value) {
346 this.identifier = value;
347 }
348
349
350
351
352
353
354
355
356
357 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
358 public String getName() {
359 return name;
360 }
361
362
363
364
365
366
367
368
369
370 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
371 public void setName(String value) {
372 this.name = value;
373 }
374
375
376
377
378
379
380
381
382
383 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
384 public String getClazz() {
385 return clazz;
386 }
387
388
389
390
391
392
393
394
395
396 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
397 public void setClazz(String value) {
398 this.clazz = value;
399 }
400
401
402
403
404
405
406
407
408
409 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
410 public boolean isStateless() {
411 if (stateless == null) {
412 return false;
413 } else {
414 return stateless;
415 }
416 }
417
418
419
420
421
422
423
424
425
426 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
427 public void setStateless(Boolean value) {
428 this.stateless = value;
429 }
430
431
432
433
434
435
436
437
438
439
440
441 @SuppressWarnings("unchecked")
442 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
443 private static void copyAny(final List<Object> source, final List<Object> target) {
444
445 if ((source!= null)&&(!source.isEmpty())) {
446 for (final Iterator<?> it = source.iterator(); it.hasNext(); ) {
447 final Object next = it.next();
448 if (next instanceof Element) {
449
450 target.add(((Element)((Element) next).cloneNode(true)));
451 continue;
452 }
453 if (next instanceof Object) {
454
455 target.add(copyOf(((Object) next)));
456 continue;
457 }
458
459 throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Any' of class 'org.jomc.model.Instance'."));
460 }
461 }
462 }
463
464
465
466
467
468
469
470
471
472 @SuppressWarnings("unchecked")
473 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
474 private static Object copyOf(final Object o) {
475
476 try {
477 if (o!= null) {
478 if (o.getClass().isPrimitive()) {
479 return o;
480 }
481 if (o.getClass().isArray()) {
482 return copyOfArray(o);
483 }
484
485 if (o instanceof Boolean) {
486 return o;
487 }
488 if (o instanceof Byte) {
489 return o;
490 }
491 if (o instanceof Character) {
492 return o;
493 }
494 if (o instanceof Double) {
495 return o;
496 }
497 if (o instanceof Enum) {
498 return o;
499 }
500 if (o instanceof Float) {
501 return o;
502 }
503 if (o instanceof Integer) {
504 return o;
505 }
506 if (o instanceof Long) {
507 return o;
508 }
509 if (o instanceof Short) {
510 return o;
511 }
512 if (o instanceof String) {
513 return o;
514 }
515 if (o instanceof BigDecimal) {
516 return o;
517 }
518 if (o instanceof BigInteger) {
519 return o;
520 }
521 if (o instanceof UUID) {
522 return o;
523 }
524 if (o instanceof QName) {
525 return o;
526 }
527 if (o instanceof Duration) {
528 return o;
529 }
530 if (o instanceof Currency) {
531 return o;
532 }
533
534 if (o instanceof File) {
535 return new File(o.toString());
536 }
537 if (o instanceof URI) {
538 return new URI(o.toString());
539 }
540 if (o instanceof URL) {
541 return new URL(o.toString());
542 }
543 if (o instanceof MimeType) {
544 return new MimeType(o.toString());
545 }
546
547 if (o instanceof XMLGregorianCalendar) {
548 return ((XMLGregorianCalendar) o).clone();
549 }
550 if (o instanceof Date) {
551 return ((Date) o).clone();
552 }
553 if (o instanceof Calendar) {
554 return ((Calendar) o).clone();
555 }
556 if (o instanceof TimeZone) {
557 return ((TimeZone) o).clone();
558 }
559 if (o instanceof Locale) {
560 return ((Locale) o).clone();
561 }
562 if (o instanceof Element) {
563 return ((Element)((Element) o).cloneNode(true));
564 }
565 if (o instanceof JAXBElement) {
566 return copyOf(((JAXBElement) o));
567 }
568 try {
569 return o.getClass().getMethod("clone", ((Class[]) null)).invoke(o, ((Object[]) null));
570 } catch (NoSuchMethodException e) {
571 if (o instanceof Serializable) {
572 return copyOf(((Serializable) o));
573 }
574
575 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
576 } catch (IllegalAccessException e) {
577
578 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
579 } catch (InvocationTargetException e) {
580
581 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
582 } catch (SecurityException e) {
583
584 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
585 } catch (IllegalArgumentException e) {
586
587 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
588 } catch (ExceptionInInitializerError e) {
589
590 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
591 }
592 }
593 return null;
594 } catch (MalformedURLException e) {
595 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
596 } catch (MimeTypeParseException e) {
597 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
598 } catch (URISyntaxException e) {
599 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
600 }
601 }
602
603
604
605
606
607
608
609
610
611 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
612 private static Object copyOfArray(final Object array) {
613
614 if (array!= null) {
615 if (array.getClass() == boolean[].class) {
616 return copyOf(((boolean[]) array));
617 }
618 if (array.getClass() == byte[].class) {
619 return copyOf(((byte[]) array));
620 }
621 if (array.getClass() == char[].class) {
622 return copyOf(((char[]) array));
623 }
624 if (array.getClass() == double[].class) {
625 return copyOf(((double[]) array));
626 }
627 if (array.getClass() == float[].class) {
628 return copyOf(((float[]) array));
629 }
630 if (array.getClass() == int[].class) {
631 return copyOf(((int[]) array));
632 }
633 if (array.getClass() == long[].class) {
634 return copyOf(((long[]) array));
635 }
636 if (array.getClass() == short[].class) {
637 return copyOf(((short[]) array));
638 }
639 final int len = Array.getLength(array);
640 final Object copy = Array.newInstance(array.getClass().getComponentType(), len);
641 for (int i = (len- 1); (i >= 0); i--) {
642 Array.set(copy, i, copyOf(Array.get(array, i)));
643 }
644 return copy;
645 }
646 return null;
647 }
648
649
650
651
652
653
654
655
656
657 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
658 private static boolean[] copyOf(final boolean[] array) {
659
660 if (array!= null) {
661 final boolean[] copy = ((boolean[]) Array.newInstance(array.getClass().getComponentType(), array.length));
662 System.arraycopy(array, 0, copy, 0, array.length);
663 return copy;
664 }
665 return null;
666 }
667
668
669
670
671
672
673
674
675
676 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
677 private static byte[] copyOf(final byte[] array) {
678
679 if (array!= null) {
680 final byte[] copy = ((byte[]) Array.newInstance(array.getClass().getComponentType(), array.length));
681 System.arraycopy(array, 0, copy, 0, array.length);
682 return copy;
683 }
684 return null;
685 }
686
687
688
689
690
691
692
693
694
695 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
696 private static char[] copyOf(final char[] array) {
697
698 if (array!= null) {
699 final char[] copy = ((char[]) Array.newInstance(array.getClass().getComponentType(), array.length));
700 System.arraycopy(array, 0, copy, 0, array.length);
701 return copy;
702 }
703 return null;
704 }
705
706
707
708
709
710
711
712
713
714 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
715 private static double[] copyOf(final double[] array) {
716
717 if (array!= null) {
718 final double[] copy = ((double[]) Array.newInstance(array.getClass().getComponentType(), array.length));
719 System.arraycopy(array, 0, copy, 0, array.length);
720 return copy;
721 }
722 return null;
723 }
724
725
726
727
728
729
730
731
732
733 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
734 private static float[] copyOf(final float[] array) {
735
736 if (array!= null) {
737 final float[] copy = ((float[]) Array.newInstance(array.getClass().getComponentType(), array.length));
738 System.arraycopy(array, 0, copy, 0, array.length);
739 return copy;
740 }
741 return null;
742 }
743
744
745
746
747
748
749
750
751
752 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
753 private static int[] copyOf(final int[] array) {
754
755 if (array!= null) {
756 final int[] copy = ((int[]) Array.newInstance(array.getClass().getComponentType(), array.length));
757 System.arraycopy(array, 0, copy, 0, array.length);
758 return copy;
759 }
760 return null;
761 }
762
763
764
765
766
767
768
769
770
771 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
772 private static long[] copyOf(final long[] array) {
773
774 if (array!= null) {
775 final long[] copy = ((long[]) Array.newInstance(array.getClass().getComponentType(), array.length));
776 System.arraycopy(array, 0, copy, 0, array.length);
777 return copy;
778 }
779 return null;
780 }
781
782
783
784
785
786
787
788
789
790 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
791 private static short[] copyOf(final short[] array) {
792
793 if (array!= null) {
794 final short[] copy = ((short[]) Array.newInstance(array.getClass().getComponentType(), array.length));
795 System.arraycopy(array, 0, copy, 0, array.length);
796 return copy;
797 }
798 return null;
799 }
800
801
802
803
804
805
806
807
808
809 @SuppressWarnings("unchecked")
810 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
811 private static JAXBElement copyOf(final JAXBElement element) {
812
813 if (element!= null) {
814 final JAXBElement copy = new JAXBElement(element.getName(), element.getDeclaredType(), element.getScope(), element.getValue());
815 copy.setNil(element.isNil());
816 copy.setValue(copyOf(copy.getValue()));
817 return copy;
818 }
819 return null;
820 }
821
822
823
824
825
826
827
828
829
830 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
831 private static Serializable copyOf(final Serializable serializable) {
832
833 if (serializable!= null) {
834 try {
835 final ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream();
836 final ObjectOutputStream out = new ObjectOutputStream(byteArrayOutput);
837 out.writeObject(serializable);
838 out.close();
839 final ByteArrayInputStream byteArrayInput = new ByteArrayInputStream(byteArrayOutput.toByteArray());
840 final ObjectInputStream in = new ObjectInputStream(byteArrayInput);
841 final Serializable copy = ((Serializable) in.readObject());
842 in.close();
843 return copy;
844 } catch (SecurityException e) {
845 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
846 } catch (ClassNotFoundException e) {
847 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
848 } catch (InvalidClassException e) {
849 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
850 } catch (NotSerializableException e) {
851 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
852 } catch (StreamCorruptedException e) {
853 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
854 } catch (OptionalDataException e) {
855 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
856 } catch (IOException e) {
857 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
858 }
859 }
860 return null;
861 }
862
863
864
865
866
867
868
869
870 @Override
871 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
872 public Instance clone() {
873 {
874
875 final Instance clone = ((Instance) super.clone());
876
877 clone.specifications = ((this.specifications == null)?null:((this.getSpecifications() == null)?null:this.getSpecifications().clone()));
878
879 clone.dependencies = ((this.dependencies == null)?null:((this.getDependencies() == null)?null:this.getDependencies().clone()));
880
881 clone.properties = ((this.properties == null)?null:((this.getProperties() == null)?null:this.getProperties().clone()));
882
883 clone.messages = ((this.messages == null)?null:((this.getMessages() == null)?null:this.getMessages().clone()));
884
885 if (this.any!= null) {
886 clone.any = null;
887 copyAny(this.getAny(), clone.getAny());
888 }
889
890 clone.identifier = ((this.identifier == null)?null:this.getIdentifier());
891
892 clone.name = ((this.name == null)?null:this.getName());
893
894 clone.clazz = ((this.clazz == null)?null:this.getClazz());
895
896 clone.stateless = ((this.stateless == null)?null:this.isStateless());
897 return clone;
898 }
899 }
900
901
902
903
904
905 @javax.xml.bind.annotation.XmlTransient
906 private static final Class<?>[] NO_CLASSES =
907 {
908 };
909
910
911 @javax.xml.bind.annotation.XmlTransient private java.util.Map<String, Object> dependencyObjects;
912
913
914
915
916
917 @javax.xml.bind.annotation.XmlTransient private java.util.Map<String, java.util.Map<java.util.Locale, java.text.MessageFormat>> messageObjects;
918
919
920 @javax.xml.bind.annotation.XmlTransient private java.util.Map<String, Object> propertyObjects;
921
922
923
924
925
926
927
928
929 public java.util.Map<String, Object> getDependencyObjects()
930 {
931 if ( this.dependencyObjects == null )
932 {
933 this.dependencyObjects = new java.util.HashMap<String, Object>();
934 }
935
936 return this.dependencyObjects;
937 }
938
939
940
941
942
943
944
945
946
947
948 public java.util.Map<String, java.util.Map<java.util.Locale, java.text.MessageFormat>> getMessageObjects()
949 {
950 if ( this.messageObjects == null )
951 {
952 this.messageObjects =
953 new java.util.HashMap<String, java.util.Map<java.util.Locale, java.text.MessageFormat>>();
954
955 }
956
957 return this.messageObjects;
958 }
959
960
961
962
963
964
965
966
967 public java.util.Map<String, Object> getPropertyObjects()
968 {
969 if ( this.propertyObjects == null )
970 {
971 this.propertyObjects = new java.util.HashMap<String, Object>();
972 }
973
974 return this.propertyObjects;
975 }
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991 public Class<?> getJavaClass( final ClassLoader classLoader ) throws ClassNotFoundException
992 {
993 return Class.forName( this.getClazz(), false, classLoader );
994 }
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011 public Class<?>[] getJavaClasses( final ClassLoader classLoader ) throws ClassNotFoundException
1012 {
1013 final java.util.Set<Class<?>> classes = new java.util.HashSet<Class<?>>();
1014
1015 if ( this.getSpecifications() != null )
1016 {
1017 for ( int i = 0, s0 = this.getSpecifications().getSpecification().size(); i < s0; i++ )
1018 {
1019 final Specification s = this.getSpecifications().getSpecification().get( i );
1020 final Class<?> javaClass = s.getJavaClass( classLoader );
1021
1022 if ( javaClass != null )
1023 {
1024 classes.add( javaClass );
1025 }
1026 }
1027 }
1028
1029 return classes.toArray( new Class<?>[ classes.size() ] );
1030 }
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047 public java.lang.reflect.Constructor<?> getJavaConstructor( final ClassLoader classLoader )
1048 throws ClassNotFoundException
1049 {
1050 java.lang.reflect.Constructor<?> javaConstructor = null;
1051 final Class<?> javaClass = this.getJavaClass( classLoader );
1052
1053 if ( java.lang.reflect.Modifier.isPublic( javaClass.getModifiers() )
1054 && !java.lang.reflect.Modifier.isAbstract( javaClass.getModifiers() ) )
1055 {
1056 try
1057 {
1058 javaConstructor = javaClass.getConstructor( NO_CLASSES );
1059 }
1060 catch ( final NoSuchMethodException e )
1061 {
1062 javaConstructor = null;
1063 }
1064 }
1065
1066 return javaConstructor;
1067 }
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079 public String getJavaFactoryMethodName()
1080 {
1081 String methodName = null;
1082
1083 char[] c = this.getName().toCharArray();
1084 c[0] = Character.toUpperCase( c[0] );
1085 methodName = "get" + String.valueOf( c );
1086
1087 boolean javaIdentifier = Character.isJavaIdentifierStart( c[0] );
1088 if ( javaIdentifier )
1089 {
1090 for ( int idx = c.length - 1; idx > 0; idx-- )
1091 {
1092 if ( !Character.isJavaIdentifierPart( c[idx] ) )
1093 {
1094 javaIdentifier = false;
1095 break;
1096 }
1097 }
1098 }
1099
1100 if ( !javaIdentifier )
1101 {
1102 methodName = null;
1103 }
1104
1105 return methodName;
1106 }
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124 public java.lang.reflect.Method getJavaFactoryMethod( final ClassLoader classLoader )
1125 throws ClassNotFoundException
1126 {
1127 final Class<?> javaClass = this.getJavaClass( classLoader );
1128 java.lang.reflect.Method factoryMethod = null;
1129 String methodName = this.getJavaFactoryMethodName();
1130
1131 if ( methodName != null )
1132 {
1133 try
1134 {
1135 factoryMethod = javaClass.getMethod( methodName, (Class[]) null );
1136 }
1137 catch ( final NoSuchMethodException e )
1138 {
1139 factoryMethod = null;
1140 }
1141 }
1142
1143 if ( factoryMethod == null )
1144 {
1145 try
1146 {
1147 factoryMethod = javaClass.getMethod( "getObject", (Class[]) null );
1148 }
1149 catch ( final NoSuchMethodException e )
1150 {
1151 factoryMethod = null;
1152 }
1153 }
1154
1155 return factoryMethod;
1156 }
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176 public boolean isJavaClassAssignable( final ClassLoader classLoader ) throws ClassNotFoundException
1177 {
1178 boolean assignable = true;
1179 final Class<?> javaClass = this.getJavaClass( classLoader );
1180 final Class<?>[] javaClasses = this.getJavaClasses( classLoader );
1181
1182 for ( int i = javaClasses.length - 1; i >= 0; i-- )
1183 {
1184 if ( !javaClasses[i].isAssignableFrom( javaClass ) )
1185 {
1186 assignable = false;
1187 break;
1188 }
1189 }
1190
1191 return assignable;
1192 }
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209 public Class<?> getJavaProxyClass( final ClassLoader classLoader ) throws ClassNotFoundException
1210 {
1211 final Class<?>[] javaClasses = this.getJavaClasses( classLoader );
1212 boolean canProxy = javaClasses.length > 0;
1213
1214 if ( canProxy )
1215 {
1216 for ( int i = javaClasses.length - 1; i >= 0; i-- )
1217 {
1218 if ( !javaClasses[i].isInterface() )
1219 {
1220 canProxy = false;
1221 break;
1222 }
1223 }
1224 }
1225
1226 return canProxy ? java.lang.reflect.Proxy.getProxyClass( classLoader, javaClasses ) : null;
1227 }
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247 @Deprecated
1248 public javax.xml.bind.JAXBElement getAnyElement( final String namespaceURI, final String localPart )
1249 {
1250 return this.getAnyElement( this.getAny(), namespaceURI, localPart );
1251 }
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270 @Deprecated
1271 public java.util.List<javax.xml.bind.JAXBElement> getAnyElements( final String namespaceURI,
1272 final String localPart )
1273 {
1274 return this.getAnyElements( this.getAny(), namespaceURI, localPart );
1275 }
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296 public <T> javax.xml.bind.JAXBElement<T> getAnyElement( final String namespaceURI, final String localPart,
1297 final Class<T> type )
1298 {
1299 return this.getAnyElement( this.getAny(), namespaceURI, localPart, type );
1300 }
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320 public <T> java.util.List<javax.xml.bind.JAXBElement<T>> getAnyElements( final String namespaceURI,
1321 final String localPart,
1322 final Class<T> type )
1323 {
1324 return this.getAnyElements( this.getAny(), namespaceURI, localPart, type );
1325 }
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341 public <T> T getAnyObject( final Class<T> clazz )
1342 {
1343 return this.getAnyObject( this.getAny(), clazz );
1344 }
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359 public <T> java.util.List<T> getAnyObjects( final Class<T> clazz )
1360 {
1361 return this.getAnyObjects( this.getAny(), clazz );
1362 }
1363
1364 }