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 @XmlAccessorType(XmlAccessType.FIELD)
95 @XmlType(name = "Dependency", namespace = "http://jomc.org/model", propOrder = {
96 "dependencies",
97 "properties",
98 "messages",
99 "any"
100 })
101 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
102 public class Dependency
103 extends SpecificationReference
104 implements Cloneable
105 {
106
107 @XmlElement(namespace = "http://jomc.org/model")
108 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
109 protected Dependencies dependencies;
110 @XmlElement(namespace = "http://jomc.org/model")
111 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
112 protected Properties properties;
113 @XmlElement(namespace = "http://jomc.org/model")
114 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
115 protected Messages messages;
116 @XmlAnyElement(lax = true)
117 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
118 protected List<Object> any;
119 @XmlAttribute(name = "implementationName")
120 @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
121 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
122 protected String implementationName;
123 @XmlAttribute(name = "name", required = true)
124 @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
125 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
126 protected String name;
127 @XmlAttribute(name = "bound")
128 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
129 protected Boolean bound;
130 @XmlAttribute(name = "optional")
131 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
132 protected Boolean optional;
133
134
135
136
137
138 public Dependency() {
139
140 super();
141 }
142
143
144
145
146
147
148
149
150
151
152 public Dependency(final Dependency o) {
153
154 super(o);
155 if (o == null) {
156 throw new NullPointerException("Cannot create a copy of 'Dependency' from 'null'.");
157 }
158
159 this.dependencies = ((o.dependencies == null)?null:((o.getDependencies() == null)?null:o.getDependencies().clone()));
160
161 this.properties = ((o.properties == null)?null:((o.getProperties() == null)?null:o.getProperties().clone()));
162
163 this.messages = ((o.messages == null)?null:((o.getMessages() == null)?null:o.getMessages().clone()));
164
165 if (o.any!= null) {
166 copyAny(o.getAny(), this.getAny());
167 }
168
169 this.implementationName = ((o.implementationName == null)?null:o.getImplementationName());
170
171 this.name = ((o.name == null)?null:o.getName());
172
173 this.bound = ((o.bound == null)?null:o.isBound());
174
175 this.optional = ((o.optional == null)?null:o.isOptional());
176 }
177
178
179
180
181
182
183
184
185
186 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
187 public Dependencies getDependencies() {
188 return dependencies;
189 }
190
191
192
193
194
195
196
197
198
199 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
200 public void setDependencies(Dependencies value) {
201 this.dependencies = value;
202 }
203
204
205
206
207
208
209
210
211
212 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
213 public Properties getProperties() {
214 return properties;
215 }
216
217
218
219
220
221
222
223
224
225 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
226 public void setProperties(Properties value) {
227 this.properties = value;
228 }
229
230
231
232
233
234
235
236
237
238 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
239 public Messages getMessages() {
240 return messages;
241 }
242
243
244
245
246
247
248
249
250
251 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
252 public void setMessages(Messages value) {
253 this.messages = value;
254 }
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
280 public List<Object> getAny() {
281 if (any == null) {
282 any = new ArrayList<Object>();
283 }
284 return this.any;
285 }
286
287
288
289
290
291
292
293
294
295 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
296 public String getImplementationName() {
297 return implementationName;
298 }
299
300
301
302
303
304
305
306
307
308 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
309 public void setImplementationName(String value) {
310 this.implementationName = value;
311 }
312
313
314
315
316
317
318
319
320
321 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
322 public String getName() {
323 return name;
324 }
325
326
327
328
329
330
331
332
333
334 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
335 public void setName(String value) {
336 this.name = value;
337 }
338
339
340
341
342
343
344
345
346
347 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
348 public boolean isBound() {
349 if (bound == null) {
350 return true;
351 } else {
352 return bound;
353 }
354 }
355
356
357
358
359
360
361
362
363
364 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
365 public void setBound(Boolean value) {
366 this.bound = value;
367 }
368
369
370
371
372
373
374
375
376
377 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
378 public boolean isOptional() {
379 if (optional == null) {
380 return false;
381 } else {
382 return optional;
383 }
384 }
385
386
387
388
389
390
391
392
393
394 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
395 public void setOptional(Boolean value) {
396 this.optional = value;
397 }
398
399
400
401
402
403
404
405
406
407
408
409 @SuppressWarnings("unchecked")
410 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
411 private static void copyAny(final List<Object> source, final List<Object> target) {
412
413 if ((source!= null)&&(!source.isEmpty())) {
414 for (final Iterator<?> it = source.iterator(); it.hasNext(); ) {
415 final Object next = it.next();
416 if (next instanceof Element) {
417
418 target.add(((Element)((Element) next).cloneNode(true)));
419 continue;
420 }
421 if (next instanceof Object) {
422
423 target.add(copyOf(((Object) next)));
424 continue;
425 }
426
427 throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Any' of class 'org.jomc.model.Dependency'."));
428 }
429 }
430 }
431
432
433
434
435
436
437
438
439
440 @SuppressWarnings("unchecked")
441 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
442 private static Object copyOf(final Object o) {
443
444 try {
445 if (o!= null) {
446 if (o.getClass().isPrimitive()) {
447 return o;
448 }
449 if (o.getClass().isArray()) {
450 return copyOfArray(o);
451 }
452
453 if (o instanceof Boolean) {
454 return o;
455 }
456 if (o instanceof Byte) {
457 return o;
458 }
459 if (o instanceof Character) {
460 return o;
461 }
462 if (o instanceof Double) {
463 return o;
464 }
465 if (o instanceof Enum) {
466 return o;
467 }
468 if (o instanceof Float) {
469 return o;
470 }
471 if (o instanceof Integer) {
472 return o;
473 }
474 if (o instanceof Long) {
475 return o;
476 }
477 if (o instanceof Short) {
478 return o;
479 }
480 if (o instanceof String) {
481 return o;
482 }
483 if (o instanceof BigDecimal) {
484 return o;
485 }
486 if (o instanceof BigInteger) {
487 return o;
488 }
489 if (o instanceof UUID) {
490 return o;
491 }
492 if (o instanceof QName) {
493 return o;
494 }
495 if (o instanceof Duration) {
496 return o;
497 }
498 if (o instanceof Currency) {
499 return o;
500 }
501
502 if (o instanceof File) {
503 return new File(o.toString());
504 }
505 if (o instanceof URI) {
506 return new URI(o.toString());
507 }
508 if (o instanceof URL) {
509 return new URL(o.toString());
510 }
511 if (o instanceof MimeType) {
512 return new MimeType(o.toString());
513 }
514
515 if (o instanceof XMLGregorianCalendar) {
516 return ((XMLGregorianCalendar) o).clone();
517 }
518 if (o instanceof Date) {
519 return ((Date) o).clone();
520 }
521 if (o instanceof Calendar) {
522 return ((Calendar) o).clone();
523 }
524 if (o instanceof TimeZone) {
525 return ((TimeZone) o).clone();
526 }
527 if (o instanceof Locale) {
528 return ((Locale) o).clone();
529 }
530 if (o instanceof Element) {
531 return ((Element)((Element) o).cloneNode(true));
532 }
533 if (o instanceof JAXBElement) {
534 return copyOf(((JAXBElement) o));
535 }
536 try {
537 return o.getClass().getMethod("clone", ((Class[]) null)).invoke(o, ((Object[]) null));
538 } catch (NoSuchMethodException e) {
539 if (o instanceof Serializable) {
540 return copyOf(((Serializable) o));
541 }
542
543 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
544 } catch (IllegalAccessException e) {
545
546 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
547 } catch (InvocationTargetException e) {
548
549 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
550 } catch (SecurityException e) {
551
552 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
553 } catch (IllegalArgumentException e) {
554
555 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
556 } catch (ExceptionInInitializerError e) {
557
558 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
559 }
560 }
561 return null;
562 } catch (MimeTypeParseException e) {
563 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
564 } catch (URISyntaxException e) {
565 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
566 } catch (MalformedURLException e) {
567 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
568 }
569 }
570
571
572
573
574
575
576
577
578
579 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
580 private static Object copyOfArray(final Object array) {
581
582 if (array!= null) {
583 if (array.getClass() == boolean[].class) {
584 return copyOf(((boolean[]) array));
585 }
586 if (array.getClass() == byte[].class) {
587 return copyOf(((byte[]) array));
588 }
589 if (array.getClass() == char[].class) {
590 return copyOf(((char[]) array));
591 }
592 if (array.getClass() == double[].class) {
593 return copyOf(((double[]) array));
594 }
595 if (array.getClass() == float[].class) {
596 return copyOf(((float[]) array));
597 }
598 if (array.getClass() == int[].class) {
599 return copyOf(((int[]) array));
600 }
601 if (array.getClass() == long[].class) {
602 return copyOf(((long[]) array));
603 }
604 if (array.getClass() == short[].class) {
605 return copyOf(((short[]) array));
606 }
607 final int len = Array.getLength(array);
608 final Object copy = Array.newInstance(array.getClass().getComponentType(), len);
609 for (int i = (len- 1); (i >= 0); i--) {
610 Array.set(copy, i, copyOf(Array.get(array, i)));
611 }
612 return copy;
613 }
614 return null;
615 }
616
617
618
619
620
621
622
623
624
625 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
626 private static boolean[] copyOf(final boolean[] array) {
627
628 if (array!= null) {
629 final boolean[] copy = ((boolean[]) Array.newInstance(array.getClass().getComponentType(), array.length));
630 System.arraycopy(array, 0, copy, 0, array.length);
631 return copy;
632 }
633 return null;
634 }
635
636
637
638
639
640
641
642
643
644 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
645 private static byte[] copyOf(final byte[] array) {
646
647 if (array!= null) {
648 final byte[] copy = ((byte[]) Array.newInstance(array.getClass().getComponentType(), array.length));
649 System.arraycopy(array, 0, copy, 0, array.length);
650 return copy;
651 }
652 return null;
653 }
654
655
656
657
658
659
660
661
662
663 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
664 private static char[] copyOf(final char[] array) {
665
666 if (array!= null) {
667 final char[] copy = ((char[]) Array.newInstance(array.getClass().getComponentType(), array.length));
668 System.arraycopy(array, 0, copy, 0, array.length);
669 return copy;
670 }
671 return null;
672 }
673
674
675
676
677
678
679
680
681
682 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
683 private static double[] copyOf(final double[] array) {
684
685 if (array!= null) {
686 final double[] copy = ((double[]) Array.newInstance(array.getClass().getComponentType(), array.length));
687 System.arraycopy(array, 0, copy, 0, array.length);
688 return copy;
689 }
690 return null;
691 }
692
693
694
695
696
697
698
699
700
701 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
702 private static float[] copyOf(final float[] array) {
703
704 if (array!= null) {
705 final float[] copy = ((float[]) Array.newInstance(array.getClass().getComponentType(), array.length));
706 System.arraycopy(array, 0, copy, 0, array.length);
707 return copy;
708 }
709 return null;
710 }
711
712
713
714
715
716
717
718
719
720 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
721 private static int[] copyOf(final int[] array) {
722
723 if (array!= null) {
724 final int[] copy = ((int[]) Array.newInstance(array.getClass().getComponentType(), array.length));
725 System.arraycopy(array, 0, copy, 0, array.length);
726 return copy;
727 }
728 return null;
729 }
730
731
732
733
734
735
736
737
738
739 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
740 private static long[] copyOf(final long[] array) {
741
742 if (array!= null) {
743 final long[] copy = ((long[]) Array.newInstance(array.getClass().getComponentType(), array.length));
744 System.arraycopy(array, 0, copy, 0, array.length);
745 return copy;
746 }
747 return null;
748 }
749
750
751
752
753
754
755
756
757
758 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
759 private static short[] copyOf(final short[] array) {
760
761 if (array!= null) {
762 final short[] copy = ((short[]) Array.newInstance(array.getClass().getComponentType(), array.length));
763 System.arraycopy(array, 0, copy, 0, array.length);
764 return copy;
765 }
766 return null;
767 }
768
769
770
771
772
773
774
775
776
777 @SuppressWarnings("unchecked")
778 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
779 private static JAXBElement copyOf(final JAXBElement element) {
780
781 if (element!= null) {
782 final JAXBElement copy = new JAXBElement(element.getName(), element.getDeclaredType(), element.getScope(), element.getValue());
783 copy.setNil(element.isNil());
784 copy.setValue(copyOf(copy.getValue()));
785 return copy;
786 }
787 return null;
788 }
789
790
791
792
793
794
795
796
797
798 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
799 private static Serializable copyOf(final Serializable serializable) {
800
801 if (serializable!= null) {
802 try {
803 final ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream();
804 final ObjectOutputStream out = new ObjectOutputStream(byteArrayOutput);
805 out.writeObject(serializable);
806 out.close();
807 final ByteArrayInputStream byteArrayInput = new ByteArrayInputStream(byteArrayOutput.toByteArray());
808 final ObjectInputStream in = new ObjectInputStream(byteArrayInput);
809 final Serializable copy = ((Serializable) in.readObject());
810 in.close();
811 return copy;
812 } catch (SecurityException e) {
813 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
814 } catch (ClassNotFoundException e) {
815 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
816 } catch (InvalidClassException e) {
817 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
818 } catch (NotSerializableException e) {
819 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
820 } catch (StreamCorruptedException e) {
821 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
822 } catch (OptionalDataException e) {
823 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
824 } catch (IOException e) {
825 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
826 }
827 }
828 return null;
829 }
830
831
832
833
834
835
836
837
838 @Override
839 @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-04-21T08:43:16+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
840 public Dependency clone() {
841 {
842
843 final Dependency clone = ((Dependency) super.clone());
844
845 clone.dependencies = ((this.dependencies == null)?null:((this.getDependencies() == null)?null:this.getDependencies().clone()));
846
847 clone.properties = ((this.properties == null)?null:((this.getProperties() == null)?null:this.getProperties().clone()));
848
849 clone.messages = ((this.messages == null)?null:((this.getMessages() == null)?null:this.getMessages().clone()));
850
851 if (this.any!= null) {
852 clone.any = null;
853 copyAny(this.getAny(), clone.getAny());
854 }
855
856 clone.implementationName = ((this.implementationName == null)?null:this.getImplementationName());
857
858 clone.name = ((this.name == null)?null:this.getName());
859
860 clone.bound = ((this.bound == null)?null:this.isBound());
861
862 clone.optional = ((this.optional == null)?null:this.isOptional());
863 return clone;
864 }
865 }
866
867
868
869
870
871
872
873
874
875
876
877
878 public JavaIdentifier getJavaGetterMethodName() throws ModelObjectException
879 {
880 try
881 {
882 return JavaIdentifier.parse( "get" + JavaIdentifier.normalize(
883 this.getName() != null ? this.getName() : "", JavaIdentifier.NormalizationMode.CAMEL_CASE ) );
884
885 }
886 catch ( final java.text.ParseException e )
887 {
888 throw new ModelObjectException( getMessage( "javaIdentifierParseException", this.getName(),
889 getMessage( e ) ), e );
890
891 }
892 }
893
894
895
896
897
898
899
900
901
902
903
904
905 public JavaIdentifier getJavaSetterMethodName() throws ModelObjectException
906 {
907 try
908 {
909 return JavaIdentifier.parse( "set" + JavaIdentifier.normalize(
910 this.getName() != null ? this.getName() : "", JavaIdentifier.NormalizationMode.CAMEL_CASE ) );
911
912 }
913 catch ( final java.text.ParseException e )
914 {
915 throw new ModelObjectException( getMessage( "javaIdentifierParseException", this.getName(),
916 getMessage( e ) ), e );
917
918 }
919 }
920
921
922
923
924
925
926
927
928
929
930
931
932 public JavaIdentifier getJavaVariableName() throws ModelObjectException
933 {
934 try
935 {
936 return JavaIdentifier.normalize( this.getName() != null ? this.getName() : "",
937 JavaIdentifier.NormalizationMode.VARIABLE_NAME_CONVENTION );
938
939 }
940 catch ( final java.text.ParseException e )
941 {
942 throw new ModelObjectException( getMessage( "javaIdentifierParseException", this.getName(),
943 getMessage( e ) ), e );
944
945 }
946 }
947
948
949
950
951
952
953
954
955
956
957
958
959 public JavaIdentifier getJavaConstantName() throws ModelObjectException
960 {
961 try
962 {
963 return JavaIdentifier.normalize( this.getName() != null ? this.getName() : "",
964 JavaIdentifier.NormalizationMode.CONSTANT_NAME_CONVENTION );
965
966 }
967 catch ( final java.text.ParseException e )
968 {
969 throw new ModelObjectException( getMessage( "javaIdentifierParseException", this.getName(),
970 getMessage( e ) ), e );
971
972 }
973 }
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993 @Deprecated
994 public javax.xml.bind.JAXBElement getAnyElement( final String namespaceURI, final String localPart )
995 {
996 return this.getAnyElement( this.getAny(), namespaceURI, localPart );
997 }
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016 @Deprecated
1017 public java.util.List<javax.xml.bind.JAXBElement> getAnyElements( final String namespaceURI,
1018 final String localPart )
1019 {
1020 return this.getAnyElements( this.getAny(), namespaceURI, localPart );
1021 }
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042 public <T> javax.xml.bind.JAXBElement<T> getAnyElement( final String namespaceURI, final String localPart,
1043 final Class<T> type )
1044 {
1045 return this.getAnyElement( this.getAny(), namespaceURI, localPart, type );
1046 }
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066 public <T> java.util.List<javax.xml.bind.JAXBElement<T>> getAnyElements( final String namespaceURI,
1067 final String localPart,
1068 final Class<T> type )
1069 {
1070 return this.getAnyElements( this.getAny(), namespaceURI, localPart, type );
1071 }
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087 public <T> T getAnyObject( final Class<T> clazz )
1088 {
1089 return this.getAnyObject( this.getAny(), clazz );
1090 }
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105 public <T> java.util.List<T> getAnyObjects( final Class<T> clazz )
1106 {
1107 return this.getAnyObjects( this.getAny(), clazz );
1108 }
1109
1110 private static String getMessage( final Throwable t )
1111 {
1112 return t != null
1113 ? t.getMessage() != null && t.getMessage().trim().length() > 0
1114 ? t.getMessage()
1115 : getMessage( t.getCause() )
1116 : null;
1117
1118 }
1119
1120 private static String getMessage( final String key, final Object... arguments )
1121 {
1122 return java.text.MessageFormat.format( java.util.ResourceBundle.getBundle(
1123 Dependency.class.getName().replace( '.', '/' ), java.util.Locale.getDefault() ).
1124 getString( key ), arguments );
1125
1126 }
1127
1128 }