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.ArrayList; 026 import java.util.Calendar; 027 import java.util.Currency; 028 import java.util.Date; 029 import java.util.Iterator; 030 import java.util.List; 031 import java.util.Locale; 032 import java.util.TimeZone; 033 import java.util.UUID; 034 import javax.annotation.Generated; 035 import javax.xml.bind.JAXBElement; 036 import javax.xml.bind.annotation.XmlAccessType; 037 import javax.xml.bind.annotation.XmlAccessorType; 038 import javax.xml.bind.annotation.XmlAnyElement; 039 import javax.xml.bind.annotation.XmlAttribute; 040 import javax.xml.bind.annotation.XmlElement; 041 import javax.xml.bind.annotation.XmlType; 042 import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; 043 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; 044 import javax.xml.datatype.Duration; 045 import javax.xml.datatype.XMLGregorianCalendar; 046 import javax.xml.namespace.QName; 047 import org.w3c.dom.Element; 048 049 050 /** 051 * 052 * Model of a message. 053 * 054 * The 'Message' type defines attributes 'name', 'final' and 'override'. Attribute 'name' holds a name uniquely identifying 055 * the message in a set of messages. Attribute 'final' flags a message the final node in an inheritance hierarchy. 056 * Attribute 'override' flags a message as intended to override a super-message. A message defines a localizable template 057 * and format arguments. 058 * 059 * 060 * <p>Java class for Message complex type. 061 * 062 * <p>The following schema fragment specifies the expected content contained within this class. 063 * 064 * <pre> 065 * <complexType name="Message"> 066 * <complexContent> 067 * <extension base="{http://jomc.org/model}ModelObject"> 068 * <sequence> 069 * <element ref="{http://jomc.org/model}template"/> 070 * <element ref="{http://jomc.org/model}arguments" minOccurs="0"/> 071 * <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/> 072 * </sequence> 073 * <attribute name="name" use="required" type="{http://jomc.org/model}Identifier" /> 074 * <attribute name="final" type="{http://jomc.org/model}Flag" default="false" /> 075 * <attribute name="override" type="{http://jomc.org/model}Flag" default="false" /> 076 * </extension> 077 * </complexContent> 078 * </complexType> 079 * </pre> 080 * 081 * 082 */ 083 @XmlAccessorType(XmlAccessType.FIELD) 084 @XmlType(name = "Message", propOrder = { 085 "template", 086 "arguments", 087 "any" 088 }) 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 public class Message 091 extends ModelObject 092 implements Cloneable 093 { 094 095 @XmlElement(required = true) 096 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 097 protected Texts template; 098 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 099 protected Arguments arguments; 100 @XmlAnyElement(lax = true) 101 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 102 protected List<Object> any; 103 @XmlAttribute(required = true) 104 @XmlJavaTypeAdapter(CollapsedStringAdapter.class) 105 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 106 protected String name; 107 @XmlAttribute(name = "final") 108 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 109 protected Boolean _final; 110 @XmlAttribute 111 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 112 protected Boolean override; 113 114 /** 115 * Creates a new {@code Message} instance. 116 * 117 */ 118 public Message() { 119 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 120 super(); 121 } 122 123 /** 124 * Creates a new {@code Message} instance by deeply copying a given {@code Message} instance. 125 * 126 * 127 * @param o 128 * The instance to copy. 129 * @throws NullPointerException 130 * if {@code o} is {@code null}. 131 */ 132 public Message(final Message o) { 133 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 134 super(o); 135 if (o == null) { 136 throw new NullPointerException("Cannot create a copy of 'Message' from 'null'."); 137 } 138 // CClassInfo: org.jomc.model.Texts 139 this.template = ((o.getTemplate() == null)?null:o.getTemplate().clone()); 140 // CClassInfo: org.jomc.model.Arguments 141 this.arguments = ((o.getArguments() == null)?null:o.getArguments().clone()); 142 // 'Any' collection. 143 copyAny(o.getAny(), getAny()); 144 // CBuiltinLeafInfo: java.lang.String 145 this.name = o.getName(); 146 // CBuiltinLeafInfo: java.lang.Boolean 147 this._final = o.isFinal(); 148 // CBuiltinLeafInfo: java.lang.Boolean 149 this.override = o.isOverride(); 150 } 151 152 /** 153 * The localizable template of this message. 154 * 155 * @return 156 * possible object is 157 * {@link Texts } 158 * 159 */ 160 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 161 public Texts getTemplate() { 162 return template; 163 } 164 165 /** 166 * Sets the value of the template property. 167 * 168 * @param value 169 * allowed object is 170 * {@link Texts } 171 * 172 */ 173 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 174 public void setTemplate(Texts value) { 175 this.template = value; 176 } 177 178 /** 179 * The format arguments of this message or {@code null}. 180 * 181 * @return 182 * possible object is 183 * {@link Arguments } 184 * 185 */ 186 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 187 public Arguments getArguments() { 188 return arguments; 189 } 190 191 /** 192 * Sets the value of the arguments property. 193 * 194 * @param value 195 * allowed object is 196 * {@link Arguments } 197 * 198 */ 199 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 200 public void setArguments(Arguments value) { 201 this.arguments = value; 202 } 203 204 /** 205 * Gets the value of the any property. 206 * 207 * <p> 208 * This accessor method returns a reference to the live list, 209 * not a snapshot. Therefore any modification you make to the 210 * returned list will be present inside the JAXB object. 211 * This is why there is not a <CODE>set</CODE> method for the any property. 212 * 213 * <p> 214 * For example, to add a new item, do as follows: 215 * <pre> 216 * getAny().add(newItem); 217 * </pre> 218 * 219 * 220 * <p> 221 * Objects of the following type(s) are allowed in the list 222 * {@link Element } 223 * {@link Object } 224 * 225 * 226 */ 227 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 228 public List<Object> getAny() { 229 if (any == null) { 230 any = new ArrayList<Object>(); 231 } 232 return this.any; 233 } 234 235 /** 236 * The name of this message. 237 * 238 * @return 239 * possible object is 240 * {@link String } 241 * 242 */ 243 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 244 public String getName() { 245 return name; 246 } 247 248 /** 249 * Sets the value of the name property. 250 * 251 * @param value 252 * allowed object is 253 * {@link String } 254 * 255 */ 256 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 257 public void setName(String value) { 258 this.name = value; 259 } 260 261 /** 262 * {@code true} if this message is the final node in an inheritance hierarchy. 263 * 264 * @return 265 * possible object is 266 * {@link Boolean } 267 * 268 */ 269 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 270 public boolean isFinal() { 271 if (_final == null) { 272 return false; 273 } else { 274 return _final; 275 } 276 } 277 278 /** 279 * Sets the value of the final property. 280 * 281 * @param value 282 * allowed object is 283 * {@link Boolean } 284 * 285 */ 286 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 287 public void setFinal(Boolean value) { 288 this._final = value; 289 } 290 291 /** 292 * {@code true} if this message is intended to override a super message. 293 * 294 * @return 295 * possible object is 296 * {@link Boolean } 297 * 298 */ 299 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 300 public boolean isOverride() { 301 if (override == null) { 302 return false; 303 } else { 304 return override; 305 } 306 } 307 308 /** 309 * Sets the value of the override property. 310 * 311 * @param value 312 * allowed object is 313 * {@link Boolean } 314 * 315 */ 316 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 317 public void setOverride(Boolean value) { 318 this.override = value; 319 } 320 321 /** 322 * Copies all values of property {@code Any} deeply. 323 * 324 * @param target 325 * The target to copy {@code source} to. 326 * @param source 327 * The source to copy from. 328 * @throws NullPointerException 329 * if {@code source} or {@code target} is {@code null}. 330 */ 331 @SuppressWarnings("unchecked") 332 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 333 private static void copyAny(final List<Object> source, final List<Object> target) { 334 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 335 if (!source.isEmpty()) { 336 for (Iterator it = source.iterator(); it.hasNext(); ) { 337 final Object next = it.next(); 338 if (next instanceof Element) { 339 // CWildcardTypeInfo: org.w3c.dom.Element 340 target.add(((Element)((Element) next).cloneNode(true))); 341 continue; 342 } 343 if (next instanceof Object) { 344 // CBuiltinLeafInfo: java.lang.Object 345 target.add(copyOfObject(((Object) next))); 346 continue; 347 } 348 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ 349 throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Any' of class 'org.jomc.model.Message'.")); 350 } 351 } 352 } 353 354 /** 355 * Creates and returns a deep copy of a given object. 356 * 357 * @param o 358 * The instance to copy or {@code null}. 359 * @return 360 * A deep copy of {@code o} or {@code null} if {@code o} is {@code null}. 361 */ 362 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 363 private static Object copyOfObject(final Object o) { 364 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 365 if (o!= null) { 366 if (o.getClass().isPrimitive()) { 367 return o; 368 } 369 if (o.getClass().isArray()) { 370 return copyOfArray(o); 371 } 372 if (o instanceof Boolean) { 373 return o; 374 } 375 if (o instanceof Byte) { 376 return o; 377 } 378 if (o instanceof Character) { 379 return o; 380 } 381 if (o instanceof Double) { 382 return o; 383 } 384 if (o instanceof Enum) { 385 return o; 386 } 387 if (o instanceof Float) { 388 return o; 389 } 390 if (o instanceof Integer) { 391 return o; 392 } 393 if (o instanceof Long) { 394 return o; 395 } 396 if (o instanceof Short) { 397 return o; 398 } 399 if (o instanceof String) { 400 return o; 401 } 402 if (o instanceof BigDecimal) { 403 return o; 404 } 405 if (o instanceof BigInteger) { 406 return o; 407 } 408 if (o instanceof UUID) { 409 return o; 410 } 411 if (o instanceof QName) { 412 return o; 413 } 414 if (o instanceof Duration) { 415 return o; 416 } 417 if (o instanceof Currency) { 418 return o; 419 } 420 if (o instanceof XMLGregorianCalendar) { 421 return ((XMLGregorianCalendar) o).clone(); 422 } 423 if (o instanceof Date) { 424 return ((Date) o).clone(); 425 } 426 if (o instanceof Calendar) { 427 return ((Calendar) o).clone(); 428 } 429 if (o instanceof TimeZone) { 430 return ((TimeZone) o).clone(); 431 } 432 if (o instanceof Locale) { 433 return ((Locale) o).clone(); 434 } 435 if (o instanceof Element) { 436 return ((Element)((Element) o).cloneNode(true)); 437 } 438 if (o instanceof JAXBElement) { 439 return copyOFJAXBElement(((JAXBElement) o)); 440 } 441 try { 442 return o.getClass().getMethod("clone", ((Class[]) null)).invoke(o, ((Object[]) null)); 443 } catch (NoSuchMethodException e) { 444 if (o instanceof Serializable) { 445 return copyOfSerializable(((Serializable) o)); 446 } 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 } catch (IllegalAccessException e) { 450 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ 451 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); 452 } catch (InvocationTargetException e) { 453 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ 454 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); 455 } catch (SecurityException e) { 456 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ 457 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); 458 } catch (IllegalArgumentException e) { 459 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ 460 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); 461 } catch (ExceptionInInitializerError e) { 462 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ 463 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); 464 } 465 } 466 return null; 467 } 468 469 /** 470 * Creates and returns a deep copy of a given array. 471 * 472 * @param array 473 * The array to copy or {@code null}. 474 * @return 475 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. 476 */ 477 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 478 private static Object copyOfArray(final Object array) { 479 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 480 if (array!= null) { 481 if (array.getClass() == boolean[].class) { 482 return copyOf(((boolean[]) array)); 483 } 484 if (array.getClass() == byte[].class) { 485 return copyOf(((byte[]) array)); 486 } 487 if (array.getClass() == char[].class) { 488 return copyOf(((char[]) array)); 489 } 490 if (array.getClass() == double[].class) { 491 return copyOf(((double[]) array)); 492 } 493 if (array.getClass() == float[].class) { 494 return copyOf(((float[]) array)); 495 } 496 if (array.getClass() == int[].class) { 497 return copyOf(((int[]) array)); 498 } 499 if (array.getClass() == long[].class) { 500 return copyOf(((long[]) array)); 501 } 502 if (array.getClass() == short[].class) { 503 return copyOf(((short[]) array)); 504 } 505 final int len = Array.getLength(array); 506 final Object copy = Array.newInstance(array.getClass().getComponentType(), len); 507 for (int i = (len- 1); (i >= 0); i--) { 508 Array.set(copy, i, copyOfObject(Array.get(array, i))); 509 } 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-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 524 private static boolean[] copyOf(final boolean[] array) { 525 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 526 if (array!= null) { 527 final boolean[] copy = ((boolean[]) 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-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 543 private static byte[] copyOf(final byte[] array) { 544 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 545 if (array!= null) { 546 final byte[] copy = ((byte[]) 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-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 562 private static char[] copyOf(final char[] array) { 563 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 564 if (array!= null) { 565 final char[] copy = ((char[]) 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-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 581 private static double[] copyOf(final double[] array) { 582 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 583 if (array!= null) { 584 final double[] copy = ((double[]) 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-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 600 private static float[] copyOf(final float[] array) { 601 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 602 if (array!= null) { 603 final float[] copy = ((float[]) 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-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 619 private static int[] copyOf(final int[] array) { 620 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 621 if (array!= null) { 622 final int[] copy = ((int[]) 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 array. 631 * 632 * @param array 633 * The array to copy or {@code null}. 634 * @return 635 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. 636 */ 637 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 638 private static long[] copyOf(final long[] array) { 639 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 640 if (array!= null) { 641 final long[] copy = ((long[]) Array.newInstance(array.getClass().getComponentType(), array.length)); 642 System.arraycopy(array, 0, copy, 0, array.length); 643 return copy; 644 } 645 return null; 646 } 647 648 /** 649 * Creates and returns a deep copy of a given array. 650 * 651 * @param array 652 * The array to copy or {@code null}. 653 * @return 654 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. 655 */ 656 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 657 private static short[] copyOf(final short[] array) { 658 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 659 if (array!= null) { 660 final short[] copy = ((short[]) Array.newInstance(array.getClass().getComponentType(), array.length)); 661 System.arraycopy(array, 0, copy, 0, array.length); 662 return copy; 663 } 664 return null; 665 } 666 667 /** 668 * Creates and returns a deep copy of a given {@code JAXBElement} instance. 669 * 670 * @param element 671 * The instance to copy or {@code null}. 672 * @return 673 * A deep copy of {@code element} or {@code null} if {@code element} is {@code null}. 674 */ 675 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 676 private static JAXBElement copyOFJAXBElement(final JAXBElement element) { 677 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 678 if (element!= null) { 679 final JAXBElement copy = new JAXBElement(element.getName(), element.getDeclaredType(), element.getScope(), element.getValue()); 680 copy.setNil(element.isNil()); 681 copy.setValue(copyOfObject(copy.getValue())); 682 return copy; 683 } 684 return null; 685 } 686 687 /** 688 * Creates and returns a deep copy of a given {@code Serializable}. 689 * 690 * @param serializable 691 * The instance to copy or {@code null}. 692 * @return 693 * A deep copy of {@code serializable} or {@code null} if {@code serializable} is {@code null}. 694 */ 695 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 696 private static Serializable copyOfSerializable(final Serializable serializable) { 697 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 698 if (serializable!= null) { 699 try { 700 final ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream(); 701 final ObjectOutputStream out = new ObjectOutputStream(byteArrayOutput); 702 out.writeObject(serializable); 703 out.close(); 704 final ByteArrayInputStream byteArrayInput = new ByteArrayInputStream(byteArrayOutput.toByteArray()); 705 final ObjectInputStream in = new ObjectInputStream(byteArrayInput); 706 final Serializable copy = ((Serializable) in.readObject()); 707 in.close(); 708 return copy; 709 } catch (SecurityException e) { 710 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); 711 } catch (ClassNotFoundException e) { 712 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); 713 } catch (InvalidClassException e) { 714 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); 715 } catch (NotSerializableException e) { 716 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); 717 } catch (StreamCorruptedException e) { 718 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); 719 } catch (OptionalDataException e) { 720 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); 721 } catch (IOException e) { 722 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); 723 } 724 } 725 return null; 726 } 727 728 /** 729 * Creates and returns a deep copy of this object. 730 * 731 * 732 * @return 733 * A deep copy of this object. 734 */ 735 @Override 736 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") 737 public Message clone() { 738 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 739 return new Message(this); 740 } 741 742 }