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.09.21 at 10:35:38 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-09-21T10:35:38+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-09-21T10:35:38+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-09-21T10:35:38+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-09-21T10:35:38+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-09-21T10:35:38+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
080 protected String value;
081
082 /**
083 * Creates a new {@code Property} instance.
084 *
085 */
086 public Property() {
087 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
088 super();
089 }
090
091 /**
092 * Creates a new {@code Property} instance by deeply copying a given instance.
093 *
094 * @param o
095 * The instance to copy or {@code null}.
096 */
097 public Property(final Property o) {
098 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
099 super(o);
100 if (o!= null) {
101 {
102 // 'Any' property.
103 this.any = copyAny(o.getAny());
104 // CBuiltinLeafInfo: java.lang.String
105 this.name = ((String) o.getName());
106 // CBuiltinLeafInfo: java.lang.String
107 this.type = ((String) o.getType());
108 // CBuiltinLeafInfo: java.lang.String
109 this.value = ((String) o.getValue());
110 }
111 }
112 }
113
114 /**
115 * Object value of this property or {@code null}.
116 *
117 * @return
118 * possible object is
119 * {@link Element }
120 * {@link Object }
121 *
122 */
123 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-09-21T10:35:38+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
124 public Object getAny() {
125 return any;
126 }
127
128 /**
129 * Sets the value of the any property.
130 *
131 * @param value
132 * allowed object is
133 * {@link Element }
134 * {@link Object }
135 *
136 */
137 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-09-21T10:35:38+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
138 public void setAny(Object value) {
139 this.any = value;
140 }
141
142 /**
143 * Name of this property.
144 *
145 * @return
146 * possible object is
147 * {@link String }
148 *
149 */
150 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-09-21T10:35:38+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
151 public String getName() {
152 return name;
153 }
154
155 /**
156 * Sets the value of the name property.
157 *
158 * @param value
159 * allowed object is
160 * {@link String }
161 *
162 */
163 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-09-21T10:35:38+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
164 public void setName(String value) {
165 this.name = value;
166 }
167
168 /**
169 * Type of this property or {@code null} for the default text type.
170 *
171 * @return
172 * possible object is
173 * {@link String }
174 *
175 */
176 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-09-21T10:35:38+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
177 public String getType() {
178 return type;
179 }
180
181 /**
182 * Sets the value of the type property.
183 *
184 * @param value
185 * allowed object is
186 * {@link String }
187 *
188 */
189 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-09-21T10:35:38+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
190 public void setType(String value) {
191 this.type = value;
192 }
193
194 /**
195 * String value of this property or {@code null}.
196 *
197 * @return
198 * possible object is
199 * {@link String }
200 *
201 */
202 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-09-21T10:35:38+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
203 public String getValue() {
204 return value;
205 }
206
207 /**
208 * Sets the value of the value property.
209 *
210 * @param value
211 * allowed object is
212 * {@link String }
213 *
214 */
215 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-09-21T10:35:38+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
216 public void setValue(String value) {
217 this.value = value;
218 }
219
220 /**
221 * Creates and returns a deep copy of property {@code Any}.
222 *
223 * @param source
224 * The source to copy from or {@code null}.
225 * @return
226 * A deep copy of {@code source} or {@code null} if {@code source} is {@code null}.
227 */
228 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-09-21T10:35:38+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
229 private static Object copyAny(final Object source) {
230 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
231 if (source!= null) {
232 if (source instanceof Element) {
233 // CWildcardTypeInfo: org.w3c.dom.Element
234 return ((Element)((Element) source).cloneNode(true));
235 }
236 if (source instanceof Object) {
237 // CBuiltinLeafInfo: java.lang.Object
238 return copyOfObject(((Object) source));
239 }
240 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
241 throw new AssertionError((("Unexpected instance '"+ source)+"' for property 'Any' of class 'org.jomc.model.Property'."));
242 }
243 return null;
244 }
245
246 /**
247 * Creates and returns a deep copy of a given object.
248 *
249 * @param o
250 * The instance to copy or {@code null}.
251 * @return
252 * A deep copy of {@code o} or {@code null} if {@code o} is {@code null}.
253 */
254 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-09-21T10:35:38+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
255 private static Object copyOfObject(final Object o) {
256 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
257 if (o!= null) {
258 if (o.getClass().isPrimitive()) {
259 return o;
260 }
261 if (o.getClass().isArray()) {
262 return copyOfArray(o);
263 }
264 if (o instanceof Boolean) {
265 return o;
266 }
267 if (o instanceof Byte) {
268 return o;
269 }
270 if (o instanceof Character) {
271 return o;
272 }
273 if (o instanceof Double) {
274 return o;
275 }
276 if (o instanceof Enum) {
277 return o;
278 }
279 if (o instanceof Float) {
280 return o;
281 }
282 if (o instanceof Integer) {
283 return o;
284 }
285 if (o instanceof Long) {
286 return o;
287 }
288 if (o instanceof Short) {
289 return o;
290 }
291 if (o instanceof String) {
292 return o;
293 }
294 if (o instanceof BigDecimal) {
295 return o;
296 }
297 if (o instanceof BigInteger) {
298 return o;
299 }
300 if (o instanceof UUID) {
301 return o;
302 }
303 if (o instanceof QName) {
304 return o;
305 }
306 if (o instanceof Duration) {
307 return o;
308 }
309 if (o instanceof Currency) {
310 return o;
311 }
312 if (o instanceof XMLGregorianCalendar) {
313 return ((XMLGregorianCalendar) o).clone();
314 }
315 if (o instanceof Date) {
316 return ((Date) o).clone();
317 }
318 if (o instanceof Calendar) {
319 return ((Calendar) o).clone();
320 }
321 if (o instanceof TimeZone) {
322 return ((TimeZone) o).clone();
323 }
324 if (o instanceof Locale) {
325 return ((Locale) o).clone();
326 }
327 if (o instanceof Element) {
328 return ((Element)((Element) o).cloneNode(true));
329 }
330 if (o instanceof JAXBElement) {
331 return copyOFJAXBElement(((JAXBElement) o));
332 }
333 try {
334 return o.getClass().getMethod("clone", ((Class[]) null)).invoke(o, ((Object[]) null));
335 } catch (NoSuchMethodException e) {
336 if (o instanceof Serializable) {
337 return copyOfSerializable(((Serializable) o));
338 }
339 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
340 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
341 } catch (IllegalAccessException e) {
342 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
343 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
344 } catch (InvocationTargetException e) {
345 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
346 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
347 } catch (SecurityException e) {
348 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
349 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
350 } catch (IllegalArgumentException e) {
351 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
352 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
353 } catch (ExceptionInInitializerError e) {
354 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
355 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
356 }
357 }
358 return null;
359 }
360
361 /**
362 * Creates and returns a deep copy of a given array.
363 *
364 * @param array
365 * The array to copy or {@code null}.
366 * @return
367 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
368 */
369 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-09-21T10:35:38+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
370 private static Object copyOfArray(final Object array) {
371 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
372 if (array!= null) {
373 if (array.getClass() == boolean[].class) {
374 return copyOf(((boolean[]) array));
375 }
376 if (array.getClass() == byte[].class) {
377 return copyOf(((byte[]) array));
378 }
379 if (array.getClass() == char[].class) {
380 return copyOf(((char[]) array));
381 }
382 if (array.getClass() == double[].class) {
383 return copyOf(((double[]) array));
384 }
385 if (array.getClass() == float[].class) {
386 return copyOf(((float[]) array));
387 }
388 if (array.getClass() == int[].class) {
389 return copyOf(((int[]) array));
390 }
391 if (array.getClass() == long[].class) {
392 return copyOf(((long[]) array));
393 }
394 if (array.getClass() == short[].class) {
395 return copyOf(((short[]) array));
396 }
397 final int len = Array.getLength(array);
398 final Object copy = Array.newInstance(array.getClass().getComponentType(), len);
399 for (int i = (len- 1); (i >= 0); i--) {
400 Array.set(copy, i, copyOfObject(Array.get(array, i)));
401 }
402 return copy;
403 }
404 return null;
405 }
406
407 /**
408 * Creates and returns a deep copy of a given array.
409 *
410 * @param array
411 * The array to copy or {@code null}.
412 * @return
413 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
414 */
415 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-09-21T10:35:38+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
416 private static boolean[] copyOf(final boolean[] array) {
417 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
418 if (array!= null) {
419 final boolean[] copy = ((boolean[]) Array.newInstance(array.getClass().getComponentType(), array.length));
420 System.arraycopy(array, 0, copy, 0, array.length);
421 return copy;
422 }
423 return null;
424 }
425
426 /**
427 * Creates and returns a deep copy of a given array.
428 *
429 * @param array
430 * The array to copy or {@code null}.
431 * @return
432 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
433 */
434 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-09-21T10:35:38+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
435 private static byte[] copyOf(final byte[] array) {
436 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
437 if (array!= null) {
438 final byte[] copy = ((byte[]) Array.newInstance(array.getClass().getComponentType(), array.length));
439 System.arraycopy(array, 0, copy, 0, array.length);
440 return copy;
441 }
442 return null;
443 }
444
445 /**
446 * Creates and returns a deep copy of a given array.
447 *
448 * @param array
449 * The array to copy or {@code null}.
450 * @return
451 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
452 */
453 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-09-21T10:35:38+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
454 private static char[] copyOf(final char[] array) {
455 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
456 if (array!= null) {
457 final char[] copy = ((char[]) Array.newInstance(array.getClass().getComponentType(), array.length));
458 System.arraycopy(array, 0, copy, 0, array.length);
459 return copy;
460 }
461 return null;
462 }
463
464 /**
465 * Creates and returns a deep copy of a given array.
466 *
467 * @param array
468 * The array to copy or {@code null}.
469 * @return
470 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
471 */
472 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-09-21T10:35:38+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
473 private static double[] copyOf(final double[] array) {
474 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
475 if (array!= null) {
476 final double[] copy = ((double[]) Array.newInstance(array.getClass().getComponentType(), array.length));
477 System.arraycopy(array, 0, copy, 0, array.length);
478 return copy;
479 }
480 return null;
481 }
482
483 /**
484 * Creates and returns a deep copy of a given array.
485 *
486 * @param array
487 * The array to copy or {@code null}.
488 * @return
489 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
490 */
491 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-09-21T10:35:38+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
492 private static float[] copyOf(final float[] array) {
493 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
494 if (array!= null) {
495 final float[] copy = ((float[]) Array.newInstance(array.getClass().getComponentType(), array.length));
496 System.arraycopy(array, 0, copy, 0, array.length);
497 return copy;
498 }
499 return null;
500 }
501
502 /**
503 * Creates and returns a deep copy of a given array.
504 *
505 * @param array
506 * The array to copy or {@code null}.
507 * @return
508 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
509 */
510 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-09-21T10:35:38+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
511 private static int[] copyOf(final int[] array) {
512 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
513 if (array!= null) {
514 final int[] copy = ((int[]) Array.newInstance(array.getClass().getComponentType(), array.length));
515 System.arraycopy(array, 0, copy, 0, array.length);
516 return copy;
517 }
518 return null;
519 }
520
521 /**
522 * Creates and returns a deep copy of a given array.
523 *
524 * @param array
525 * The array to copy or {@code null}.
526 * @return
527 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
528 */
529 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-09-21T10:35:38+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
530 private static long[] copyOf(final long[] array) {
531 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
532 if (array!= null) {
533 final long[] copy = ((long[]) Array.newInstance(array.getClass().getComponentType(), array.length));
534 System.arraycopy(array, 0, copy, 0, array.length);
535 return copy;
536 }
537 return null;
538 }
539
540 /**
541 * Creates and returns a deep copy of a given array.
542 *
543 * @param array
544 * The array to copy or {@code null}.
545 * @return
546 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
547 */
548 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-09-21T10:35:38+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
549 private static short[] copyOf(final short[] array) {
550 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
551 if (array!= null) {
552 final short[] copy = ((short[]) Array.newInstance(array.getClass().getComponentType(), array.length));
553 System.arraycopy(array, 0, copy, 0, array.length);
554 return copy;
555 }
556 return null;
557 }
558
559 /**
560 * Creates and returns a deep copy of a given {@code JAXBElement} instance.
561 *
562 * @param element
563 * The instance to copy or {@code null}.
564 * @return
565 * A deep copy of {@code element} or {@code null} if {@code element} is {@code null}.
566 */
567 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-09-21T10:35:38+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
568 private static JAXBElement copyOFJAXBElement(final JAXBElement element) {
569 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
570 if (element!= null) {
571 final JAXBElement copy = new JAXBElement(element.getName(), element.getDeclaredType(), element.getScope(), element.getValue());
572 copy.setNil(element.isNil());
573 copy.setValue(copyOfObject(copy.getValue()));
574 return copy;
575 }
576 return null;
577 }
578
579 /**
580 * Creates and returns a deep copy of a given {@code Serializable}.
581 *
582 * @param serializable
583 * The instance to copy or {@code null}.
584 * @return
585 * A deep copy of {@code serializable} or {@code null} if {@code serializable} is {@code null}.
586 */
587 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-09-21T10:35:38+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
588 private static Serializable copyOfSerializable(final Serializable serializable) {
589 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
590 if (serializable!= null) {
591 try {
592 final ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream();
593 final ObjectOutputStream out = new ObjectOutputStream(byteArrayOutput);
594 out.writeObject(serializable);
595 out.close();
596 final ByteArrayInputStream byteArrayInput = new ByteArrayInputStream(byteArrayOutput.toByteArray());
597 final ObjectInputStream in = new ObjectInputStream(byteArrayInput);
598 final Serializable copy = ((Serializable) in.readObject());
599 in.close();
600 return copy;
601 } catch (SecurityException e) {
602 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
603 } catch (ClassNotFoundException e) {
604 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
605 } catch (InvalidClassException e) {
606 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
607 } catch (NotSerializableException e) {
608 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
609 } catch (StreamCorruptedException e) {
610 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
611 } catch (OptionalDataException e) {
612 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
613 } catch (IOException e) {
614 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
615 }
616 }
617 return null;
618 }
619
620 /**
621 * Creates and returns a deep copy of this object.
622 *
623 *
624 * @return
625 * A deep copy of this object.
626 */
627 @Override
628 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-09-21T10:35:38+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
629 public Property clone() {
630 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
631 return new Property(this);
632 }
633
634 /**
635 * Gets the Java value of this property.
636 *
637 * @param classLoader The class loader to use for loading the Java class corresponding to the type of this property.
638 *
639 * @return The Java value of this property.
640 *
641 * @throws NullPointerException if {@code classLoader} is {@code null}.
642 * @throws ClassNotFoundException if the Java class corresponding to the type of this property is not found.
643 * @throws InstantiationException if instantiation of the value fails.
644 */
645 public Object getJavaValue( final ClassLoader classLoader ) throws ClassNotFoundException, InstantiationException
646 {
647 if ( classLoader == null )
648 {
649 throw new NullPointerException( "classLoader" );
650 }
651
652 if ( this.getAny() != null )
653 {
654 Object javaValue = this.getAny();
655 if ( javaValue instanceof javax.xml.bind.JAXBElement )
656 {
657 javaValue = ( (javax.xml.bind.JAXBElement) javaValue ).getValue();
658 }
659
660 return javaValue;
661 }
662
663 Class javaType = String.class;
664 if ( this.getType() != null )
665 {
666 if ( Boolean.TYPE.getName().equals( this.getType() ) )
667 {
668 javaType = Boolean.class;
669 }
670 else if ( Byte.TYPE.getName().equals( this.getType() ) )
671 {
672 javaType = Byte.class;
673 }
674 else if ( Character.TYPE.getName().equals( this.getType() ) )
675 {
676 javaType = Character.class;
677 }
678 else if ( Double.TYPE.getName().equals( this.getType() ) )
679 {
680 javaType = Double.class;
681 }
682 else if ( Float.TYPE.getName().equals( this.getType() ) )
683 {
684 javaType = Float.class;
685 }
686 else if ( Integer.TYPE.getName().equals( this.getType() ) )
687 {
688 javaType = Integer.class;
689 }
690 else if ( Long.TYPE.getName().equals( this.getType() ) )
691 {
692 javaType = Long.class;
693 }
694 else if ( Short.TYPE.getName().equals( this.getType() ) )
695 {
696 javaType = Short.class;
697 }
698 else
699 {
700 javaType = Class.forName( this.getType(), true, classLoader );
701 }
702 }
703
704 try
705 {
706 final Object arg;
707 final java.lang.reflect.Constructor ctor;
708
709 if ( javaType == Character.class )
710 {
711 ctor = javaType.getConstructor( new Class[]
712 {
713 char.class
714 } );
715
716 arg = new Character( this.getValue().charAt( 0 ) );
717 }
718 else
719 {
720 ctor = javaType.getConstructor( new Class[]
721 {
722 String.class
723 } );
724
725 arg = this.getValue();
726 }
727
728 return ctor.newInstance( new Object[]
729 {
730 arg
731 } );
732
733 }
734 catch ( IllegalAccessException e )
735 {
736 throw (InstantiationException) new InstantiationException( e.getMessage() ).initCause( e );
737 }
738 catch ( java.lang.reflect.InvocationTargetException e )
739 {
740 throw (InstantiationException) new InstantiationException( e.getMessage() ).initCause( e );
741 }
742 catch ( NoSuchMethodException e )
743 {
744 throw (InstantiationException) new InstantiationException( e.getMessage() ).initCause( e );
745 }
746 }
747
748 }