001 //
002 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-2
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: 2012.04.26 at 04:53:34 AM CEST
006 //
007
008
009 package org.jomc.model;
010
011 import java.io.ByteArrayInputStream;
012 import java.io.ByteArrayOutputStream;
013 import java.io.File;
014 import java.io.IOException;
015 import java.io.InvalidClassException;
016 import java.io.NotSerializableException;
017 import java.io.ObjectInputStream;
018 import java.io.ObjectOutputStream;
019 import java.io.OptionalDataException;
020 import java.io.Serializable;
021 import java.io.StreamCorruptedException;
022 import java.lang.reflect.Array;
023 import java.lang.reflect.InvocationTargetException;
024 import java.math.BigDecimal;
025 import java.math.BigInteger;
026 import java.net.MalformedURLException;
027 import java.net.URI;
028 import java.net.URISyntaxException;
029 import java.net.URL;
030 import java.util.ArrayList;
031 import java.util.Calendar;
032 import java.util.Currency;
033 import java.util.Date;
034 import java.util.Iterator;
035 import java.util.List;
036 import java.util.Locale;
037 import java.util.TimeZone;
038 import java.util.UUID;
039 import javax.activation.MimeType;
040 import javax.activation.MimeTypeParseException;
041 import javax.annotation.Generated;
042 import javax.xml.bind.JAXBElement;
043 import javax.xml.bind.annotation.XmlAccessType;
044 import javax.xml.bind.annotation.XmlAccessorType;
045 import javax.xml.bind.annotation.XmlAnyElement;
046 import javax.xml.bind.annotation.XmlAttribute;
047 import javax.xml.bind.annotation.XmlType;
048 import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
049 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
050 import javax.xml.datatype.Duration;
051 import javax.xml.datatype.XMLGregorianCalendar;
052 import javax.xml.namespace.QName;
053 import org.w3c.dom.Element;
054
055
056 /**
057 *
058 * Model of a message argument.
059 *
060 * The 'Argument' type defines attributes 'index', 'name' and 'type'. Attribute 'index' holds the index of the argument in
061 * a list of arguments. Attribute 'name' holds the name uniquely identifying the argument in a set of arguments. Attribute
062 * 'type' holds the type of the argument.
063 *
064 *
065 * <p>Java class for Argument complex type.
066 *
067 * <p>The following schema fragment specifies the expected content contained within this class.
068 *
069 * <pre>
070 * <complexType name="Argument">
071 * <complexContent>
072 * <extension base="{http://jomc.org/model}ModelObject">
073 * <sequence>
074 * <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
075 * </sequence>
076 * <attribute name="index" use="required" type="{http://jomc.org/model}Index" />
077 * <attribute name="name" use="required" type="{http://jomc.org/model}Identifier" />
078 * <attribute name="type" type="{http://jomc.org/model}ArgumentType" default="Text" />
079 * </extension>
080 * </complexContent>
081 * </complexType>
082 * </pre>
083 *
084 *
085 */
086 @XmlAccessorType(XmlAccessType.FIELD)
087 @XmlType(name = "Argument", namespace = "http://jomc.org/model", propOrder = {
088 "any"
089 })
090 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-04-26T04:53:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
091 public class Argument
092 extends ModelObject
093 implements Cloneable
094 {
095
096 @XmlAnyElement(lax = true)
097 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-04-26T04:53:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
098 protected List<Object> any;
099 @XmlAttribute(name = "index", required = true)
100 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-04-26T04:53:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
101 protected int index;
102 @XmlAttribute(name = "name", required = true)
103 @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
104 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-04-26T04:53:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
105 protected String name;
106 @XmlAttribute(name = "type")
107 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-04-26T04:53:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
108 protected ArgumentType type;
109
110 /**
111 * Creates a new {@code Argument} instance.
112 *
113 */
114 public Argument() {
115 // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
116 super();
117 }
118
119 /**
120 * Creates a new {@code Argument} instance by deeply copying a given {@code Argument} instance.
121 *
122 *
123 * @param o
124 * The instance to copy.
125 * @throws NullPointerException
126 * if {@code o} is {@code null}.
127 */
128 public Argument(final Argument o) {
129 // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
130 super(o);
131 if (o == null) {
132 throw new NullPointerException("Cannot create a copy of 'Argument' from 'null'.");
133 }
134 // 'Any' collection.
135 if (o.any!= null) {
136 copyAny(o.getAny(), this.getAny());
137 }
138 // CBuiltinLeafInfo: java.lang.Integer
139 this.index = o.getIndex();
140 // CBuiltinLeafInfo: java.lang.String
141 this.name = ((o.name == null)?null:o.getName());
142 // CEnumLeafInfo: org.jomc.model.ArgumentType
143 this.type = ((o.type == null)?null:o.getType());
144 }
145
146 /**
147 * Gets the value of the any property.
148 *
149 * <p>
150 * This accessor method returns a reference to the live list,
151 * not a snapshot. Therefore any modification you make to the
152 * returned list will be present inside the JAXB object.
153 * This is why there is not a <CODE>set</CODE> method for the any property.
154 *
155 * <p>
156 * For example, to add a new item, do as follows:
157 * <pre>
158 * getAny().add(newItem);
159 * </pre>
160 *
161 *
162 * <p>
163 * Objects of the following type(s) are allowed in the list
164 * {@link Object }
165 * {@link Element }
166 *
167 *
168 */
169 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-04-26T04:53:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
170 public List<Object> getAny() {
171 if (any == null) {
172 any = new ArrayList<Object>();
173 }
174 return this.any;
175 }
176
177 /**
178 * Index of this argument.
179 *
180 */
181 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-04-26T04:53:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
182 public int getIndex() {
183 return index;
184 }
185
186 /**
187 * Sets the value of the index property.
188 *
189 */
190 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-04-26T04:53:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
191 public void setIndex(int value) {
192 this.index = value;
193 }
194
195 /**
196 * Name of this argument.
197 *
198 * @return
199 * possible object is
200 * {@link String }
201 *
202 */
203 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-04-26T04:53:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
204 public String getName() {
205 return name;
206 }
207
208 /**
209 * Sets the value of the name property.
210 *
211 * @param value
212 * allowed object is
213 * {@link String }
214 *
215 */
216 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-04-26T04:53:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
217 public void setName(String value) {
218 this.name = value;
219 }
220
221 /**
222 * Type of this argument.
223 *
224 * @return
225 * possible object is
226 * {@link ArgumentType }
227 *
228 */
229 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-04-26T04:53:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
230 public ArgumentType getType() {
231 if (type == null) {
232 return ArgumentType.TEXT;
233 } else {
234 return type;
235 }
236 }
237
238 /**
239 * Sets the value of the type property.
240 *
241 * @param value
242 * allowed object is
243 * {@link ArgumentType }
244 *
245 */
246 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-04-26T04:53:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
247 public void setType(ArgumentType value) {
248 this.type = value;
249 }
250
251 /**
252 * Copies all values of property {@code Any} deeply.
253 *
254 * @param source
255 * The source to copy from.
256 * @param target
257 * The target to copy {@code source} to.
258 * @throws NullPointerException
259 * if {@code target} is {@code null}.
260 */
261 @SuppressWarnings("unchecked")
262 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-04-26T04:53:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
263 private static void copyAny(final List<Object> source, final List<Object> target) {
264 // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
265 if ((source!= null)&&(!source.isEmpty())) {
266 for (final Iterator<?> it = source.iterator(); it.hasNext(); ) {
267 final Object next = it.next();
268 if (next instanceof Element) {
269 // CWildcardTypeInfo: org.w3c.dom.Element
270 target.add(((Element)((Element) next).cloneNode(true)));
271 continue;
272 }
273 if (next instanceof Object) {
274 // CBuiltinLeafInfo: java.lang.Object
275 target.add(copyOf(((Object) next)));
276 continue;
277 }
278 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
279 throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Any' of class 'org.jomc.model.Argument'."));
280 }
281 }
282 }
283
284 /**
285 * Creates and returns a deep copy of a given object.
286 *
287 * @param o
288 * The instance to copy or {@code null}.
289 * @return
290 * A deep copy of {@code o} or {@code null} if {@code o} is {@code null}.
291 */
292 @SuppressWarnings("unchecked")
293 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-04-26T04:53:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
294 private static Object copyOf(final Object o) {
295 // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
296 try {
297 if (o!= null) {
298 if (o.getClass().isPrimitive()) {
299 return o;
300 }
301 if (o.getClass().isArray()) {
302 return copyOfArray(o);
303 }
304 // Immutable types.
305 if (o instanceof Boolean) {
306 return o;
307 }
308 if (o instanceof Byte) {
309 return o;
310 }
311 if (o instanceof Character) {
312 return o;
313 }
314 if (o instanceof Double) {
315 return o;
316 }
317 if (o instanceof Enum) {
318 return o;
319 }
320 if (o instanceof Float) {
321 return o;
322 }
323 if (o instanceof Integer) {
324 return o;
325 }
326 if (o instanceof Long) {
327 return o;
328 }
329 if (o instanceof Short) {
330 return o;
331 }
332 if (o instanceof String) {
333 return o;
334 }
335 if (o instanceof BigDecimal) {
336 return o;
337 }
338 if (o instanceof BigInteger) {
339 return o;
340 }
341 if (o instanceof UUID) {
342 return o;
343 }
344 if (o instanceof QName) {
345 return o;
346 }
347 if (o instanceof Duration) {
348 return o;
349 }
350 if (o instanceof Currency) {
351 return o;
352 }
353 // String based types.
354 if (o instanceof File) {
355 return new File(o.toString());
356 }
357 if (o instanceof URI) {
358 return new URI(o.toString());
359 }
360 if (o instanceof URL) {
361 return new URL(o.toString());
362 }
363 if (o instanceof MimeType) {
364 return new MimeType(o.toString());
365 }
366 // Cloneable types.
367 if (o instanceof XMLGregorianCalendar) {
368 return ((XMLGregorianCalendar) o).clone();
369 }
370 if (o instanceof Date) {
371 return ((Date) o).clone();
372 }
373 if (o instanceof Calendar) {
374 return ((Calendar) o).clone();
375 }
376 if (o instanceof TimeZone) {
377 return ((TimeZone) o).clone();
378 }
379 if (o instanceof Locale) {
380 return ((Locale) o).clone();
381 }
382 if (o instanceof Element) {
383 return ((Element)((Element) o).cloneNode(true));
384 }
385 if (o instanceof JAXBElement) {
386 return copyOf(((JAXBElement) o));
387 }
388 try {
389 return o.getClass().getMethod("clone", ((Class[]) null)).invoke(o, ((Object[]) null));
390 } catch (NoSuchMethodException e) {
391 if (o instanceof Serializable) {
392 return copyOf(((Serializable) o));
393 }
394 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
395 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
396 } catch (IllegalAccessException e) {
397 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
398 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
399 } catch (InvocationTargetException e) {
400 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
401 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
402 } catch (SecurityException e) {
403 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
404 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
405 } catch (IllegalArgumentException e) {
406 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
407 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
408 } catch (ExceptionInInitializerError e) {
409 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
410 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
411 }
412 }
413 return null;
414 } catch (MalformedURLException e) {
415 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
416 } catch (URISyntaxException e) {
417 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
418 } catch (MimeTypeParseException e) {
419 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
420 }
421 }
422
423 /**
424 * Creates and returns a deep copy of a given array.
425 *
426 * @param array
427 * The array to copy or {@code null}.
428 * @return
429 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
430 */
431 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-04-26T04:53:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
432 private static Object copyOfArray(final Object array) {
433 // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
434 if (array!= null) {
435 if (array.getClass() == boolean[].class) {
436 return copyOf(((boolean[]) array));
437 }
438 if (array.getClass() == byte[].class) {
439 return copyOf(((byte[]) array));
440 }
441 if (array.getClass() == char[].class) {
442 return copyOf(((char[]) array));
443 }
444 if (array.getClass() == double[].class) {
445 return copyOf(((double[]) array));
446 }
447 if (array.getClass() == float[].class) {
448 return copyOf(((float[]) array));
449 }
450 if (array.getClass() == int[].class) {
451 return copyOf(((int[]) array));
452 }
453 if (array.getClass() == long[].class) {
454 return copyOf(((long[]) array));
455 }
456 if (array.getClass() == short[].class) {
457 return copyOf(((short[]) array));
458 }
459 final int len = Array.getLength(array);
460 final Object copy = Array.newInstance(array.getClass().getComponentType(), len);
461 for (int i = (len- 1); (i >= 0); i--) {
462 Array.set(copy, i, copyOf(Array.get(array, i)));
463 }
464 return copy;
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 = "2012-04-26T04:53:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
478 private static boolean[] copyOf(final boolean[] array) {
479 // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
480 if (array!= null) {
481 final boolean[] copy = ((boolean[]) Array.newInstance(array.getClass().getComponentType(), array.length));
482 System.arraycopy(array, 0, copy, 0, array.length);
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 = "2012-04-26T04:53:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
497 private static byte[] copyOf(final byte[] array) {
498 // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
499 if (array!= null) {
500 final byte[] copy = ((byte[]) 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 = "2012-04-26T04:53:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
516 private static char[] copyOf(final char[] array) {
517 // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
518 if (array!= null) {
519 final char[] copy = ((char[]) 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 = "2012-04-26T04:53:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
535 private static double[] copyOf(final double[] array) {
536 // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
537 if (array!= null) {
538 final double[] copy = ((double[]) 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 = "2012-04-26T04:53:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
554 private static float[] copyOf(final float[] array) {
555 // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
556 if (array!= null) {
557 final float[] copy = ((float[]) 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 = "2012-04-26T04:53:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
573 private static int[] copyOf(final int[] array) {
574 // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
575 if (array!= null) {
576 final int[] copy = ((int[]) 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 = "2012-04-26T04:53:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
592 private static long[] copyOf(final long[] array) {
593 // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
594 if (array!= null) {
595 final long[] copy = ((long[]) 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 = "2012-04-26T04:53:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
611 private static short[] copyOf(final short[] array) {
612 // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
613 if (array!= null) {
614 final short[] copy = ((short[]) 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 {@code JAXBElement} instance.
623 *
624 * @param element
625 * The instance to copy or {@code null}.
626 * @return
627 * A deep copy of {@code element} or {@code null} if {@code element} is {@code null}.
628 */
629 @SuppressWarnings("unchecked")
630 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-04-26T04:53:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
631 private static JAXBElement copyOf(final JAXBElement element) {
632 // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
633 if (element!= null) {
634 final JAXBElement copy = new JAXBElement(element.getName(), element.getDeclaredType(), element.getScope(), element.getValue());
635 copy.setNil(element.isNil());
636 copy.setValue(copyOf(copy.getValue()));
637 return copy;
638 }
639 return null;
640 }
641
642 /**
643 * Creates and returns a deep copy of a given {@code Serializable}.
644 *
645 * @param serializable
646 * The instance to copy or {@code null}.
647 * @return
648 * A deep copy of {@code serializable} or {@code null} if {@code serializable} is {@code null}.
649 */
650 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-04-26T04:53:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
651 private static Serializable copyOf(final Serializable serializable) {
652 // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
653 if (serializable!= null) {
654 try {
655 final ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream();
656 final ObjectOutputStream out = new ObjectOutputStream(byteArrayOutput);
657 out.writeObject(serializable);
658 out.close();
659 final ByteArrayInputStream byteArrayInput = new ByteArrayInputStream(byteArrayOutput.toByteArray());
660 final ObjectInputStream in = new ObjectInputStream(byteArrayInput);
661 final Serializable copy = ((Serializable) in.readObject());
662 in.close();
663 return copy;
664 } catch (SecurityException e) {
665 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
666 } catch (ClassNotFoundException e) {
667 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
668 } catch (InvalidClassException e) {
669 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
670 } catch (NotSerializableException e) {
671 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
672 } catch (StreamCorruptedException e) {
673 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
674 } catch (OptionalDataException e) {
675 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
676 } catch (IOException e) {
677 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
678 }
679 }
680 return null;
681 }
682
683 /**
684 * Creates and returns a deep copy of this object.
685 *
686 *
687 * @return
688 * A deep copy of this object.
689 */
690 @Override
691 @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-04-26T04:53:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
692 public Argument clone() {
693 {
694 // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
695 final Argument clone = ((Argument) super.clone());
696 // 'Any' collection.
697 if (this.any!= null) {
698 clone.any = null;
699 copyAny(this.getAny(), clone.getAny());
700 }
701 // CBuiltinLeafInfo: java.lang.Integer
702 clone.index = this.getIndex();
703 // CBuiltinLeafInfo: java.lang.String
704 clone.name = ((this.name == null)?null:this.getName());
705 // CEnumLeafInfo: org.jomc.model.ArgumentType
706 clone.type = ((this.type == null)?null:this.getType());
707 return clone;
708 }
709 }
710
711 /**
712 * Gets a single {@code JAXBElement} matching a namespace URI and local part from the {@code any} property of the
713 * instance.
714 *
715 * @param namespaceURI The namespace URI of the {@code JAXBElement} to return.
716 * @param localPart The local part of the {@code JAXBElement} to return.
717 *
718 * @return The {@code JAXBElement} matching {@code namespaceURI} and {@code localPart} from the {@code any} property
719 * of the instance or {@code null}, if no such element is found.
720 *
721 * @throws NullPointerException if {@code namespaceURI} or {@code localPart} is {@code null}.
722 * @throws IllegalStateException if the {@code any} property contains more than one matching element.
723 *
724 * @see #getAnyElement(java.util.List, java.lang.String, java.lang.String)
725 *
726 * @deprecated As of JOMC 1.1, please use method {@link #getAnyElement(java.lang.String, java.lang.String, java.lang.Class)}.
727 * This method will be removed in version 2.0.
728 */
729 @Deprecated
730 public javax.xml.bind.JAXBElement getAnyElement( final String namespaceURI, final String localPart )
731 {
732 return this.getAnyElement( this.getAny(), namespaceURI, localPart );
733 }
734
735 /**
736 * Gets a list containing all {@code JAXBElement}s matching a namespace URI and local part from the {@code any}
737 * property of the instance.
738 *
739 * @param namespaceURI The namespace URI of the {@code JAXBElement}s to return.
740 * @param localPart The local part of the {@code JAXBElement}s to return.
741 *
742 * @return An unmodifiable list of all {@code JAXBElement}s matching {@code namespaceURI} and {@code localPart} from
743 * the {@code any} property of the instance - an empty list if no such elements are found.
744 *
745 * @throws NullPointerException if {@code namespaceURI} or {@code localPart} is {@code null}.
746 *
747 * @see #getAnyElements(java.util.List, java.lang.String, java.lang.String)
748 *
749 * @deprecated As of JOMC 1.1, please use method {@link #getAnyElements(java.lang.String, java.lang.String, java.lang.Class)}.
750 * This method will be removed in version 2.0.
751 */
752 @Deprecated
753 public java.util.List<javax.xml.bind.JAXBElement> getAnyElements( final String namespaceURI,
754 final String localPart )
755 {
756 return this.getAnyElements( this.getAny(), namespaceURI, localPart );
757 }
758
759 /**
760 * Gets a single {@code JAXBElement} matching a namespace URI and local part from the {@code any} property of the
761 * instance.
762 *
763 * @param namespaceURI The namespace URI of the {@code JAXBElement} to return.
764 * @param localPart The local part of the {@code JAXBElement} to return.
765 * @param type The class of the type the element is bound to.
766 * @param <T> The type the element is bound to.
767 *
768 * @return The {@code JAXBElement} matching {@code namespaceURI} and {@code localPart} from the {@code any} property
769 * of the instance or {@code null}, if no such element is found.
770 *
771 * @throws NullPointerException if {@code namespaceURI}, {@code localPart} or {@code type} is {@code null}.
772 * @throws IllegalStateException if the {@code any} property contains more than one matching element.
773 *
774 * @see #getAnyElement(java.util.List, java.lang.String, java.lang.String, java.lang.Class)
775 *
776 * @since 1.1
777 */
778 public <T> javax.xml.bind.JAXBElement<T> getAnyElement( final String namespaceURI, final String localPart,
779 final Class<T> type )
780 {
781 return this.getAnyElement( this.getAny(), namespaceURI, localPart, type );
782 }
783
784 /**
785 * Gets a list containing all {@code JAXBElement}s matching a namespace URI and local part from the {@code any}
786 * property of the instance.
787 *
788 * @param namespaceURI The namespace URI of the {@code JAXBElement}s to return.
789 * @param localPart The local part of the {@code JAXBElement}s to return.
790 * @param type The class of the type the elements are bound to.
791 * @param <T> The type the elements are bound to.
792 *
793 * @return An unmodifiable list of all {@code JAXBElement}s matching {@code namespaceURI} and {@code localPart} from
794 * the {@code any} property of the instance - an empty list if no such elements are found.
795 *
796 * @throws NullPointerException if {@code namespaceURI}, {@code localPart} or {@code type} is {@code null}.
797 *
798 * @see #getAnyElements(java.util.List, java.lang.String, java.lang.String, java.lang.Class)
799 *
800 * @since 1.1
801 */
802 public <T> java.util.List<javax.xml.bind.JAXBElement<T>> getAnyElements( final String namespaceURI,
803 final String localPart,
804 final Class<T> type )
805 {
806 return this.getAnyElements( this.getAny(), namespaceURI, localPart, type );
807 }
808
809 /**
810 * Gets a single object matching a given class from the {@code any} property of the instance.
811 *
812 * @param clazz The class to return an instance of.
813 * @param <T> The type of the object to return.
814 *
815 * @return The instance of {@code clazz} from the {@code any} property of the instance or {@code null}, if no such
816 * instance is found.
817 *
818 * @throws NullPointerException if {@code clazz} is {@code null}.
819 * @throws IllegalStateException if the {@code any} property contains more than one matching object.
820 *
821 * @see #getAnyObject(java.util.List, java.lang.Class)
822 */
823 public <T> T getAnyObject( final Class<T> clazz )
824 {
825 return this.getAnyObject( this.getAny(), clazz );
826 }
827
828 /**
829 * Gets a list containing all objects matching a given class from the {@code any} property of the instance.
830 *
831 * @param clazz The class to return all instances of.
832 * @param <T> The type of the objects to return.
833 *
834 * @return An unmodifiable list of all instances of {@code clazz} from the {@code any} property of the instance -
835 * an empty list if no such objects are found.
836 *
837 * @throws NullPointerException if {@code clazz} is {@code null}.
838 *
839 * @see #getAnyObjects(java.util.List, java.lang.Class)
840 */
841 public <T> java.util.List<T> getAnyObjects( final Class<T> clazz )
842 {
843 return this.getAnyObjects( this.getAny(), clazz );
844 }
845
846 }