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