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