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