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