001 //
002 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
003 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
004 // Any modifications to this file will be lost upon recompilation of the source schema.
005 // Generated on: 2009.10.02 at 06:07:50 PM UTC
006 //
007
008
009 package org.jomc.model;
010
011 import java.io.ByteArrayInputStream;
012 import java.io.ByteArrayOutputStream;
013 import java.io.IOException;
014 import java.io.InvalidClassException;
015 import java.io.NotSerializableException;
016 import java.io.ObjectInputStream;
017 import java.io.ObjectOutputStream;
018 import java.io.OptionalDataException;
019 import java.io.Serializable;
020 import java.io.StreamCorruptedException;
021 import java.lang.reflect.Array;
022 import java.lang.reflect.InvocationTargetException;
023 import java.math.BigDecimal;
024 import java.math.BigInteger;
025 import java.util.Calendar;
026 import java.util.Currency;
027 import java.util.Date;
028 import java.util.Locale;
029 import java.util.TimeZone;
030 import java.util.UUID;
031 import javax.annotation.Generated;
032 import javax.xml.bind.JAXBElement;
033 import javax.xml.bind.annotation.XmlAccessType;
034 import javax.xml.bind.annotation.XmlAccessorType;
035 import javax.xml.bind.annotation.XmlAnyElement;
036 import javax.xml.bind.annotation.XmlAttribute;
037 import javax.xml.bind.annotation.XmlType;
038 import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
039 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
040 import javax.xml.datatype.Duration;
041 import javax.xml.datatype.XMLGregorianCalendar;
042 import javax.xml.namespace.QName;
043 import org.w3c.dom.Element;
044
045
046 /**
047 * Model of a property.
048 * <p>A property consists of the properties {@code name}, {@code type} and
049 * {@code value}. Property {@code name} holds the name uniquely identifying the
050 * property in a set of properties. Property {@code type} holds the type of
051 * the property. Property {@code value} holds the properties value which is of type
052 * {@code type}.</p>
053 *
054 *
055 *
056 */
057 @XmlAccessorType(XmlAccessType.FIELD)
058 @XmlType(name = "Property", propOrder = {
059 "any"
060 })
061 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
062 public class Property
063 extends ModelObject
064 implements Cloneable
065 {
066
067 @XmlAnyElement(lax = true)
068 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
069 protected Object any;
070 @XmlAttribute(required = true)
071 @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
072 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
073 protected String name;
074 @XmlAttribute
075 @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
076 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
077 protected String type;
078 @XmlAttribute
079 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
080 protected String value;
081 @XmlAttribute(name = "final")
082 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
083 protected Boolean _final;
084 @XmlAttribute
085 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
086 protected Boolean override;
087
088 /**
089 * Creates a new {@code Property} instance.
090 *
091 */
092 public Property() {
093 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
094 super();
095 }
096
097 /**
098 * Creates a new {@code Property} instance by deeply copying a given instance.
099 *
100 * @param o
101 * The instance to copy or {@code null}.
102 */
103 public Property(final Property o) {
104 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
105 super(o);
106 if (o!= null) {
107 {
108 // 'Any' property.
109 this.any = copyAny(o.getAny());
110 // CBuiltinLeafInfo: java.lang.String
111 this.name = ((String) o.getName());
112 // CBuiltinLeafInfo: java.lang.String
113 this.type = ((String) o.getType());
114 // CBuiltinLeafInfo: java.lang.String
115 this.value = ((String) o.getValue());
116 // CBuiltinLeafInfo: java.lang.Boolean
117 this._final = ((Boolean) o.isFinal());
118 // CBuiltinLeafInfo: java.lang.Boolean
119 this.override = ((Boolean) o.isOverride());
120 }
121 }
122 }
123
124 /**
125 * Object value of this property or {@code null}.
126 *
127 * @return
128 * possible object is
129 * {@link Element }
130 * {@link Object }
131 *
132 */
133 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
134 public Object getAny() {
135 return any;
136 }
137
138 /**
139 * Sets the value of the any property.
140 *
141 * @param value
142 * allowed object is
143 * {@link Element }
144 * {@link Object }
145 *
146 */
147 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
148 public void setAny(Object value) {
149 this.any = value;
150 }
151
152 /**
153 * Name of this property.
154 *
155 * @return
156 * possible object is
157 * {@link String }
158 *
159 */
160 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
161 public String getName() {
162 return name;
163 }
164
165 /**
166 * Sets the value of the name property.
167 *
168 * @param value
169 * allowed object is
170 * {@link String }
171 *
172 */
173 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
174 public void setName(String value) {
175 this.name = value;
176 }
177
178 /**
179 * Type of this property or {@code null} for the default text type.
180 *
181 * @return
182 * possible object is
183 * {@link String }
184 *
185 */
186 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
187 public String getType() {
188 return type;
189 }
190
191 /**
192 * Sets the value of the type property.
193 *
194 * @param value
195 * allowed object is
196 * {@link String }
197 *
198 */
199 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
200 public void setType(String value) {
201 this.type = value;
202 }
203
204 /**
205 * String value of this property or {@code null}.
206 *
207 * @return
208 * possible object is
209 * {@link String }
210 *
211 */
212 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
213 public String getValue() {
214 return value;
215 }
216
217 /**
218 * Sets the value of the value property.
219 *
220 * @param value
221 * allowed object is
222 * {@link String }
223 *
224 */
225 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
226 public void setValue(String value) {
227 this.value = value;
228 }
229
230 /**
231 * Flags this property final.
232 *
233 * @return
234 * possible object is
235 * {@link Boolean }
236 *
237 */
238 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
239 public boolean isFinal() {
240 if (_final == null) {
241 return false;
242 } else {
243 return _final;
244 }
245 }
246
247 /**
248 * Sets the value of the final property.
249 *
250 * @param value
251 * allowed object is
252 * {@link Boolean }
253 *
254 */
255 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
256 public void setFinal(Boolean value) {
257 this._final = value;
258 }
259
260 /**
261 * True, if this property is intended to override a super property.
262 *
263 * @return
264 * possible object is
265 * {@link Boolean }
266 *
267 */
268 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
269 public boolean isOverride() {
270 if (override == null) {
271 return false;
272 } else {
273 return override;
274 }
275 }
276
277 /**
278 * Sets the value of the override property.
279 *
280 * @param value
281 * allowed object is
282 * {@link Boolean }
283 *
284 */
285 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
286 public void setOverride(Boolean value) {
287 this.override = value;
288 }
289
290 /**
291 * Creates and returns a deep copy of property {@code Any}.
292 *
293 * @param source
294 * The source to copy from or {@code null}.
295 * @return
296 * A deep copy of {@code source} or {@code null} if {@code source} is {@code null}.
297 */
298 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
299 private static Object copyAny(final Object source) {
300 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
301 if (source!= null) {
302 if (source instanceof Element) {
303 // CWildcardTypeInfo: org.w3c.dom.Element
304 return ((Element)((Element) source).cloneNode(true));
305 }
306 if (source instanceof Object) {
307 // CBuiltinLeafInfo: java.lang.Object
308 return copyOfObject(((Object) source));
309 }
310 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
311 throw new AssertionError((("Unexpected instance '"+ source)+"' for property 'Any' of class 'org.jomc.model.Property'."));
312 }
313 return null;
314 }
315
316 /**
317 * Creates and returns a deep copy of a given object.
318 *
319 * @param o
320 * The instance to copy or {@code null}.
321 * @return
322 * A deep copy of {@code o} or {@code null} if {@code o} is {@code null}.
323 */
324 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
325 private static Object copyOfObject(final Object o) {
326 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
327 if (o!= null) {
328 if (o.getClass().isPrimitive()) {
329 return o;
330 }
331 if (o.getClass().isArray()) {
332 return copyOfArray(o);
333 }
334 if (o instanceof Boolean) {
335 return o;
336 }
337 if (o instanceof Byte) {
338 return o;
339 }
340 if (o instanceof Character) {
341 return o;
342 }
343 if (o instanceof Double) {
344 return o;
345 }
346 if (o instanceof Enum) {
347 return o;
348 }
349 if (o instanceof Float) {
350 return o;
351 }
352 if (o instanceof Integer) {
353 return o;
354 }
355 if (o instanceof Long) {
356 return o;
357 }
358 if (o instanceof Short) {
359 return o;
360 }
361 if (o instanceof String) {
362 return o;
363 }
364 if (o instanceof BigDecimal) {
365 return o;
366 }
367 if (o instanceof BigInteger) {
368 return o;
369 }
370 if (o instanceof UUID) {
371 return o;
372 }
373 if (o instanceof QName) {
374 return o;
375 }
376 if (o instanceof Duration) {
377 return o;
378 }
379 if (o instanceof Currency) {
380 return o;
381 }
382 if (o instanceof XMLGregorianCalendar) {
383 return ((XMLGregorianCalendar) o).clone();
384 }
385 if (o instanceof Date) {
386 return ((Date) o).clone();
387 }
388 if (o instanceof Calendar) {
389 return ((Calendar) o).clone();
390 }
391 if (o instanceof TimeZone) {
392 return ((TimeZone) o).clone();
393 }
394 if (o instanceof Locale) {
395 return ((Locale) o).clone();
396 }
397 if (o instanceof Element) {
398 return ((Element)((Element) o).cloneNode(true));
399 }
400 if (o instanceof JAXBElement) {
401 return copyOFJAXBElement(((JAXBElement) o));
402 }
403 try {
404 return o.getClass().getMethod("clone", ((Class[]) null)).invoke(o, ((Object[]) null));
405 } catch (NoSuchMethodException e) {
406 if (o instanceof Serializable) {
407 return copyOfSerializable(((Serializable) o));
408 }
409 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
410 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
411 } catch (IllegalAccessException e) {
412 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
413 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
414 } catch (InvocationTargetException e) {
415 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
416 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
417 } catch (SecurityException e) {
418 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
419 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
420 } catch (IllegalArgumentException e) {
421 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
422 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
423 } catch (ExceptionInInitializerError e) {
424 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
425 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
426 }
427 }
428 return null;
429 }
430
431 /**
432 * Creates and returns a deep copy of a given array.
433 *
434 * @param array
435 * The array to copy or {@code null}.
436 * @return
437 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
438 */
439 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
440 private static Object copyOfArray(final Object array) {
441 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
442 if (array!= null) {
443 if (array.getClass() == boolean[].class) {
444 return copyOf(((boolean[]) array));
445 }
446 if (array.getClass() == byte[].class) {
447 return copyOf(((byte[]) array));
448 }
449 if (array.getClass() == char[].class) {
450 return copyOf(((char[]) array));
451 }
452 if (array.getClass() == double[].class) {
453 return copyOf(((double[]) array));
454 }
455 if (array.getClass() == float[].class) {
456 return copyOf(((float[]) array));
457 }
458 if (array.getClass() == int[].class) {
459 return copyOf(((int[]) array));
460 }
461 if (array.getClass() == long[].class) {
462 return copyOf(((long[]) array));
463 }
464 if (array.getClass() == short[].class) {
465 return copyOf(((short[]) array));
466 }
467 final int len = Array.getLength(array);
468 final Object copy = Array.newInstance(array.getClass().getComponentType(), len);
469 for (int i = (len- 1); (i >= 0); i--) {
470 Array.set(copy, i, copyOfObject(Array.get(array, i)));
471 }
472 return copy;
473 }
474 return null;
475 }
476
477 /**
478 * Creates and returns a deep copy of a given array.
479 *
480 * @param array
481 * The array to copy or {@code null}.
482 * @return
483 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
484 */
485 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
486 private static boolean[] copyOf(final boolean[] array) {
487 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
488 if (array!= null) {
489 final boolean[] copy = ((boolean[]) Array.newInstance(array.getClass().getComponentType(), array.length));
490 System.arraycopy(array, 0, copy, 0, array.length);
491 return copy;
492 }
493 return null;
494 }
495
496 /**
497 * Creates and returns a deep copy of a given array.
498 *
499 * @param array
500 * The array to copy or {@code null}.
501 * @return
502 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
503 */
504 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
505 private static byte[] copyOf(final byte[] array) {
506 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
507 if (array!= null) {
508 final byte[] copy = ((byte[]) Array.newInstance(array.getClass().getComponentType(), array.length));
509 System.arraycopy(array, 0, copy, 0, array.length);
510 return copy;
511 }
512 return null;
513 }
514
515 /**
516 * Creates and returns a deep copy of a given array.
517 *
518 * @param array
519 * The array to copy or {@code null}.
520 * @return
521 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
522 */
523 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
524 private static char[] copyOf(final char[] array) {
525 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
526 if (array!= null) {
527 final char[] copy = ((char[]) Array.newInstance(array.getClass().getComponentType(), array.length));
528 System.arraycopy(array, 0, copy, 0, array.length);
529 return copy;
530 }
531 return null;
532 }
533
534 /**
535 * Creates and returns a deep copy of a given array.
536 *
537 * @param array
538 * The array to copy or {@code null}.
539 * @return
540 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
541 */
542 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
543 private static double[] copyOf(final double[] array) {
544 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
545 if (array!= null) {
546 final double[] copy = ((double[]) Array.newInstance(array.getClass().getComponentType(), array.length));
547 System.arraycopy(array, 0, copy, 0, array.length);
548 return copy;
549 }
550 return null;
551 }
552
553 /**
554 * Creates and returns a deep copy of a given array.
555 *
556 * @param array
557 * The array to copy or {@code null}.
558 * @return
559 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
560 */
561 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
562 private static float[] copyOf(final float[] array) {
563 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
564 if (array!= null) {
565 final float[] copy = ((float[]) Array.newInstance(array.getClass().getComponentType(), array.length));
566 System.arraycopy(array, 0, copy, 0, array.length);
567 return copy;
568 }
569 return null;
570 }
571
572 /**
573 * Creates and returns a deep copy of a given array.
574 *
575 * @param array
576 * The array to copy or {@code null}.
577 * @return
578 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
579 */
580 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
581 private static int[] copyOf(final int[] array) {
582 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
583 if (array!= null) {
584 final int[] copy = ((int[]) Array.newInstance(array.getClass().getComponentType(), array.length));
585 System.arraycopy(array, 0, copy, 0, array.length);
586 return copy;
587 }
588 return null;
589 }
590
591 /**
592 * Creates and returns a deep copy of a given array.
593 *
594 * @param array
595 * The array to copy or {@code null}.
596 * @return
597 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
598 */
599 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
600 private static long[] copyOf(final long[] array) {
601 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
602 if (array!= null) {
603 final long[] copy = ((long[]) Array.newInstance(array.getClass().getComponentType(), array.length));
604 System.arraycopy(array, 0, copy, 0, array.length);
605 return copy;
606 }
607 return null;
608 }
609
610 /**
611 * Creates and returns a deep copy of a given array.
612 *
613 * @param array
614 * The array to copy or {@code null}.
615 * @return
616 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
617 */
618 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
619 private static short[] copyOf(final short[] array) {
620 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
621 if (array!= null) {
622 final short[] copy = ((short[]) Array.newInstance(array.getClass().getComponentType(), array.length));
623 System.arraycopy(array, 0, copy, 0, array.length);
624 return copy;
625 }
626 return null;
627 }
628
629 /**
630 * Creates and returns a deep copy of a given {@code JAXBElement} instance.
631 *
632 * @param element
633 * The instance to copy or {@code null}.
634 * @return
635 * A deep copy of {@code element} or {@code null} if {@code element} is {@code null}.
636 */
637 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
638 private static JAXBElement copyOFJAXBElement(final JAXBElement element) {
639 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
640 if (element!= null) {
641 final JAXBElement copy = new JAXBElement(element.getName(), element.getDeclaredType(), element.getScope(), element.getValue());
642 copy.setNil(element.isNil());
643 copy.setValue(copyOfObject(copy.getValue()));
644 return copy;
645 }
646 return null;
647 }
648
649 /**
650 * Creates and returns a deep copy of a given {@code Serializable}.
651 *
652 * @param serializable
653 * The instance to copy or {@code null}.
654 * @return
655 * A deep copy of {@code serializable} or {@code null} if {@code serializable} is {@code null}.
656 */
657 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
658 private static Serializable copyOfSerializable(final Serializable serializable) {
659 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
660 if (serializable!= null) {
661 try {
662 final ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream();
663 final ObjectOutputStream out = new ObjectOutputStream(byteArrayOutput);
664 out.writeObject(serializable);
665 out.close();
666 final ByteArrayInputStream byteArrayInput = new ByteArrayInputStream(byteArrayOutput.toByteArray());
667 final ObjectInputStream in = new ObjectInputStream(byteArrayInput);
668 final Serializable copy = ((Serializable) in.readObject());
669 in.close();
670 return copy;
671 } catch (SecurityException e) {
672 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
673 } catch (ClassNotFoundException e) {
674 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
675 } catch (InvalidClassException e) {
676 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
677 } catch (NotSerializableException e) {
678 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
679 } catch (StreamCorruptedException e) {
680 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
681 } catch (OptionalDataException e) {
682 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
683 } catch (IOException e) {
684 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
685 }
686 }
687 return null;
688 }
689
690 /**
691 * Creates and returns a deep copy of this object.
692 *
693 *
694 * @return
695 * A deep copy of this object.
696 */
697 @Override
698 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
699 public Property clone() {
700 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
701 return new Property(this);
702 }
703
704 /**
705 * Gets the Java value of this property.
706 *
707 * @param classLoader The class loader to use for loading the Java class corresponding to the type of this property.
708 *
709 * @return The Java value of this property.
710 *
711 * @throws NullPointerException if {@code classLoader} is {@code null}.
712 * @throws ClassNotFoundException if the Java class corresponding to the type of this property is not found.
713 * @throws InstantiationException if instantiation of the value fails.
714 */
715 public Object getJavaValue( final ClassLoader classLoader ) throws ClassNotFoundException, InstantiationException
716 {
717 if ( classLoader == null )
718 {
719 throw new NullPointerException( "classLoader" );
720 }
721
722 if ( this.getAny() != null )
723 {
724 Object javaValue = this.getAny();
725 if ( javaValue instanceof javax.xml.bind.JAXBElement )
726 {
727 javaValue = ( (javax.xml.bind.JAXBElement) javaValue ).getValue();
728 }
729
730 return javaValue;
731 }
732
733 Class javaType = String.class;
734 if ( this.getType() != null )
735 {
736 if ( Boolean.TYPE.getName().equals( this.getType() ) )
737 {
738 javaType = Boolean.class;
739 }
740 else if ( Byte.TYPE.getName().equals( this.getType() ) )
741 {
742 javaType = Byte.class;
743 }
744 else if ( Character.TYPE.getName().equals( this.getType() ) )
745 {
746 javaType = Character.class;
747 }
748 else if ( Double.TYPE.getName().equals( this.getType() ) )
749 {
750 javaType = Double.class;
751 }
752 else if ( Float.TYPE.getName().equals( this.getType() ) )
753 {
754 javaType = Float.class;
755 }
756 else if ( Integer.TYPE.getName().equals( this.getType() ) )
757 {
758 javaType = Integer.class;
759 }
760 else if ( Long.TYPE.getName().equals( this.getType() ) )
761 {
762 javaType = Long.class;
763 }
764 else if ( Short.TYPE.getName().equals( this.getType() ) )
765 {
766 javaType = Short.class;
767 }
768 else
769 {
770 javaType = Class.forName( this.getType(), true, classLoader );
771 }
772 }
773
774 Object javaValue = null;
775
776 if ( this.getValue() != null )
777 {
778 try
779 {
780 final Object arg;
781 final java.lang.reflect.Constructor ctor;
782
783 if ( javaType == Character.class )
784 {
785 ctor = javaType.getConstructor( new Class[]
786 {
787 char.class
788 } );
789
790 arg = new Character( this.getValue().charAt( 0 ) );
791 }
792 else
793 {
794 ctor = javaType.getConstructor( new Class[]
795 {
796 String.class
797 } );
798
799 arg = this.getValue();
800 }
801
802 javaValue = ctor.newInstance( new Object[]
803 {
804 arg
805 } );
806
807 }
808 catch ( IllegalAccessException e )
809 {
810 throw (InstantiationException) new InstantiationException( e.getMessage() ).initCause( e );
811 }
812 catch ( java.lang.reflect.InvocationTargetException e )
813 {
814 throw (InstantiationException) new InstantiationException( e.getMessage() ).initCause( e );
815 }
816 catch ( NoSuchMethodException e )
817 {
818 throw (InstantiationException) new InstantiationException( e.getMessage() ).initCause( e );
819 }
820 }
821
822 return javaValue;
823 }
824
825
826 }