001 //
002 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
003 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
004 // Any modifications to this file will be lost upon recompilation of the source schema.
005 // Generated on: 2009.12.07 at 03:06:36 AM UTC
006 //
007
008
009 package org.jomc.model;
010
011 import java.io.ByteArrayInputStream;
012 import java.io.ByteArrayOutputStream;
013 import java.io.IOException;
014 import java.io.InvalidClassException;
015 import java.io.NotSerializableException;
016 import java.io.ObjectInputStream;
017 import java.io.ObjectOutputStream;
018 import java.io.OptionalDataException;
019 import java.io.Serializable;
020 import java.io.StreamCorruptedException;
021 import java.lang.reflect.Array;
022 import java.lang.reflect.InvocationTargetException;
023 import java.math.BigDecimal;
024 import java.math.BigInteger;
025 import java.util.ArrayList;
026 import java.util.Calendar;
027 import java.util.Currency;
028 import java.util.Date;
029 import java.util.Iterator;
030 import java.util.List;
031 import java.util.Locale;
032 import java.util.TimeZone;
033 import java.util.UUID;
034 import javax.annotation.Generated;
035 import javax.xml.bind.JAXBElement;
036 import javax.xml.bind.annotation.XmlAccessType;
037 import javax.xml.bind.annotation.XmlAccessorType;
038 import javax.xml.bind.annotation.XmlAnyElement;
039 import javax.xml.bind.annotation.XmlAttribute;
040 import javax.xml.bind.annotation.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 *
051 * Model of a specification.
052 *
053 * The 'Specification' type defines attributes 'identifier', 'class', 'vendor', 'version', 'multiplicity' and 'scope'.
054 * Attribute 'identifier' holds an identifier uniquely identifying the specification in a set of specifications. Attribute
055 * 'class' holds the identifier of the class providing the programming interface of the specification. Attribute 'vendor'
056 * holds information regarding the vendor of the specification. Attribute 'version' holds the version of the specification.
057 * Attribute 'multiplicity' specifies the number of implementations allowed to exist among a set of modules.
058 * A specification with a multiplicity equal to 'One' specifies that no more than one implementation of the specification
059 * is allowed to exist among a set of modules (including none). A specification with a multiplicity equal to 'Many'
060 * specifies that multiple implementations of the specification are allowed to exist among a set of modules (including
061 * none). Attribute 'scope' specifies the scope instances of implementations apply to. In 'Singleton' scope, objects are
062 * bound to a system's single instance store - an object is only created if not already available in that single instance
063 * store.
064 *
065 *
066 * <p>Java class for Specification complex type.
067 *
068 * <p>The following schema fragment specifies the expected content contained within this class.
069 *
070 * <pre>
071 * <complexType name="Specification">
072 * <complexContent>
073 * <extension base="{http://jomc.org/model}ModelObject">
074 * <sequence>
075 * <element ref="{http://jomc.org/model}properties" minOccurs="0"/>
076 * <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
077 * </sequence>
078 * <attribute name="identifier" use="required" type="{http://jomc.org/model}Identifier" />
079 * <attribute name="class" type="{http://jomc.org/model}Identifier" />
080 * <attribute name="vendor" type="{http://jomc.org/model}String" />
081 * <attribute name="version" type="{http://jomc.org/model}Version" />
082 * <attribute name="multiplicity" type="{http://jomc.org/model}Multiplicity" default="Many" />
083 * <attribute name="scope" type="{http://jomc.org/model}Identifier" />
084 * </extension>
085 * </complexContent>
086 * </complexType>
087 * </pre>
088 *
089 *
090 */
091 @XmlAccessorType(XmlAccessType.FIELD)
092 @XmlType(name = "Specification", propOrder = {
093 "properties",
094 "any"
095 })
096 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
097 public class Specification
098 extends ModelObject
099 implements Cloneable
100 {
101
102 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
103 protected Properties properties;
104 @XmlAnyElement(lax = true)
105 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
106 protected List<Object> any;
107 @XmlAttribute(required = true)
108 @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
109 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
110 protected String identifier;
111 @XmlAttribute(name = "class")
112 @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
113 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
114 protected String clazz;
115 @XmlAttribute
116 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
117 protected String vendor;
118 @XmlAttribute
119 @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
120 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
121 protected String version;
122 @XmlAttribute
123 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
124 protected Multiplicity multiplicity;
125 @XmlAttribute
126 @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
127 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
128 protected String scope;
129
130 /**
131 * Creates a new {@code Specification} instance.
132 *
133 */
134 public Specification() {
135 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
136 super();
137 }
138
139 /**
140 * Creates a new {@code Specification} instance by deeply copying a given {@code Specification} instance.
141 *
142 *
143 * @param o
144 * The instance to copy.
145 * @throws NullPointerException
146 * if {@code o} is {@code null}.
147 */
148 public Specification(final Specification o) {
149 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
150 super(o);
151 if (o == null) {
152 throw new NullPointerException("Cannot create a copy of 'Specification' from 'null'.");
153 }
154 // CClassInfo: org.jomc.model.Properties
155 this.properties = ((o.getProperties() == null)?null:o.getProperties().clone());
156 // 'Any' collection.
157 copyAny(o.getAny(), getAny());
158 // CBuiltinLeafInfo: java.lang.String
159 this.identifier = o.getIdentifier();
160 // CBuiltinLeafInfo: java.lang.String
161 this.clazz = o.getClazz();
162 // CBuiltinLeafInfo: java.lang.String
163 this.vendor = o.getVendor();
164 // CBuiltinLeafInfo: java.lang.String
165 this.version = o.getVersion();
166 // CEnumLeafInfo: org.jomc.model.Multiplicity
167 this.multiplicity = o.getMultiplicity();
168 // CBuiltinLeafInfo: java.lang.String
169 this.scope = o.getScope();
170 }
171
172 /**
173 * Properties of this specification or {@code null}.
174 *
175 * @return
176 * possible object is
177 * {@link Properties }
178 *
179 */
180 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
181 public Properties getProperties() {
182 return properties;
183 }
184
185 /**
186 * Sets the value of the properties property.
187 *
188 * @param value
189 * allowed object is
190 * {@link Properties }
191 *
192 */
193 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
194 public void setProperties(Properties value) {
195 this.properties = value;
196 }
197
198 /**
199 * Gets the value of the any property.
200 *
201 * <p>
202 * This accessor method returns a reference to the live list,
203 * not a snapshot. Therefore any modification you make to the
204 * returned list will be present inside the JAXB object.
205 * This is why there is not a <CODE>set</CODE> method for the any property.
206 *
207 * <p>
208 * For example, to add a new item, do as follows:
209 * <pre>
210 * getAny().add(newItem);
211 * </pre>
212 *
213 *
214 * <p>
215 * Objects of the following type(s) are allowed in the list
216 * {@link Element }
217 * {@link Object }
218 *
219 *
220 */
221 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
222 public List<Object> getAny() {
223 if (any == null) {
224 any = new ArrayList<Object>();
225 }
226 return this.any;
227 }
228
229 /**
230 * The identifier of this specification.
231 *
232 * @return
233 * possible object is
234 * {@link String }
235 *
236 */
237 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
238 public String getIdentifier() {
239 return identifier;
240 }
241
242 /**
243 * Sets the value of the identifier property.
244 *
245 * @param value
246 * allowed object is
247 * {@link String }
248 *
249 */
250 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
251 public void setIdentifier(String value) {
252 this.identifier = value;
253 }
254
255 /**
256 * The identifier of the class providing the programming interface of this specification or {@code null}.
257 *
258 * @return
259 * possible object is
260 * {@link String }
261 *
262 */
263 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
264 public String getClazz() {
265 return clazz;
266 }
267
268 /**
269 * Sets the value of the clazz property.
270 *
271 * @param value
272 * allowed object is
273 * {@link String }
274 *
275 */
276 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
277 public void setClazz(String value) {
278 this.clazz = value;
279 }
280
281 /**
282 * The vendor of this specification or {@code null}.
283 *
284 * @return
285 * possible object is
286 * {@link String }
287 *
288 */
289 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
290 public String getVendor() {
291 return vendor;
292 }
293
294 /**
295 * Sets the value of the vendor property.
296 *
297 * @param value
298 * allowed object is
299 * {@link String }
300 *
301 */
302 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
303 public void setVendor(String value) {
304 this.vendor = value;
305 }
306
307 /**
308 * The version of this specification or {@code null}.
309 *
310 * @return
311 * possible object is
312 * {@link String }
313 *
314 */
315 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
316 public String getVersion() {
317 return version;
318 }
319
320 /**
321 * Sets the value of the version property.
322 *
323 * @param value
324 * allowed object is
325 * {@link String }
326 *
327 */
328 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
329 public void setVersion(String value) {
330 this.version = value;
331 }
332
333 /**
334 * The implementation multiplicity of this specification. A multiplicity equal to {@link Multiplicity#ONE} specifies that no more than one implementation of the specification is allowed to exist among a set of modules (including none). A multiplicity equal to {@link Multiplicity#MANY} specifies that many implementations are allowed to exist among a set of modules (including none).
335 *
336 * @return
337 * possible object is
338 * {@link Multiplicity }
339 *
340 */
341 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
342 public Multiplicity getMultiplicity() {
343 if (multiplicity == null) {
344 return Multiplicity.MANY;
345 } else {
346 return multiplicity;
347 }
348 }
349
350 /**
351 * Sets the value of the multiplicity property.
352 *
353 * @param value
354 * allowed object is
355 * {@link Multiplicity }
356 *
357 */
358 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
359 public void setMultiplicity(Multiplicity value) {
360 this.multiplicity = value;
361 }
362
363 /**
364 * Scope instances of implementations of this specification apply to or {@code null} if instances of implementations of this specification are not bound to any scope (multiton).
365 *
366 * @return
367 * possible object is
368 * {@link String }
369 *
370 */
371 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
372 public String getScope() {
373 return scope;
374 }
375
376 /**
377 * Sets the value of the scope property.
378 *
379 * @param value
380 * allowed object is
381 * {@link String }
382 *
383 */
384 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
385 public void setScope(String value) {
386 this.scope = value;
387 }
388
389 /**
390 * Copies all values of property {@code Any} deeply.
391 *
392 * @param target
393 * The target to copy {@code source} to.
394 * @param source
395 * The source to copy from.
396 * @throws NullPointerException
397 * if {@code source} or {@code target} is {@code null}.
398 */
399 @SuppressWarnings("unchecked")
400 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
401 private static void copyAny(final List<Object> source, final List<Object> target) {
402 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
403 if (!source.isEmpty()) {
404 for (Iterator it = source.iterator(); it.hasNext(); ) {
405 final Object next = it.next();
406 if (next instanceof Element) {
407 // CWildcardTypeInfo: org.w3c.dom.Element
408 target.add(((Element)((Element) next).cloneNode(true)));
409 continue;
410 }
411 if (next instanceof Object) {
412 // CBuiltinLeafInfo: java.lang.Object
413 target.add(copyOfObject(((Object) next)));
414 continue;
415 }
416 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
417 throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Any' of class 'org.jomc.model.Specification'."));
418 }
419 }
420 }
421
422 /**
423 * Creates and returns a deep copy of a given object.
424 *
425 * @param o
426 * The instance to copy or {@code null}.
427 * @return
428 * A deep copy of {@code o} or {@code null} if {@code o} is {@code null}.
429 */
430 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
431 private static Object copyOfObject(final Object o) {
432 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
433 if (o!= null) {
434 if (o.getClass().isPrimitive()) {
435 return o;
436 }
437 if (o.getClass().isArray()) {
438 return copyOfArray(o);
439 }
440 if (o instanceof Boolean) {
441 return o;
442 }
443 if (o instanceof Byte) {
444 return o;
445 }
446 if (o instanceof Character) {
447 return o;
448 }
449 if (o instanceof Double) {
450 return o;
451 }
452 if (o instanceof Enum) {
453 return o;
454 }
455 if (o instanceof Float) {
456 return o;
457 }
458 if (o instanceof Integer) {
459 return o;
460 }
461 if (o instanceof Long) {
462 return o;
463 }
464 if (o instanceof Short) {
465 return o;
466 }
467 if (o instanceof String) {
468 return o;
469 }
470 if (o instanceof BigDecimal) {
471 return o;
472 }
473 if (o instanceof BigInteger) {
474 return o;
475 }
476 if (o instanceof UUID) {
477 return o;
478 }
479 if (o instanceof QName) {
480 return o;
481 }
482 if (o instanceof Duration) {
483 return o;
484 }
485 if (o instanceof Currency) {
486 return o;
487 }
488 if (o instanceof XMLGregorianCalendar) {
489 return ((XMLGregorianCalendar) o).clone();
490 }
491 if (o instanceof Date) {
492 return ((Date) o).clone();
493 }
494 if (o instanceof Calendar) {
495 return ((Calendar) o).clone();
496 }
497 if (o instanceof TimeZone) {
498 return ((TimeZone) o).clone();
499 }
500 if (o instanceof Locale) {
501 return ((Locale) o).clone();
502 }
503 if (o instanceof Element) {
504 return ((Element)((Element) o).cloneNode(true));
505 }
506 if (o instanceof JAXBElement) {
507 return copyOFJAXBElement(((JAXBElement) o));
508 }
509 try {
510 return o.getClass().getMethod("clone", ((Class[]) null)).invoke(o, ((Object[]) null));
511 } catch (NoSuchMethodException e) {
512 if (o instanceof Serializable) {
513 return copyOfSerializable(((Serializable) o));
514 }
515 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
516 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
517 } catch (IllegalAccessException e) {
518 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
519 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
520 } catch (InvocationTargetException e) {
521 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
522 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
523 } catch (SecurityException e) {
524 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
525 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
526 } catch (IllegalArgumentException e) {
527 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
528 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
529 } catch (ExceptionInInitializerError e) {
530 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
531 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
532 }
533 }
534 return null;
535 }
536
537 /**
538 * Creates and returns a deep copy of a given array.
539 *
540 * @param array
541 * The array to copy or {@code null}.
542 * @return
543 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
544 */
545 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
546 private static Object copyOfArray(final Object array) {
547 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
548 if (array!= null) {
549 if (array.getClass() == boolean[].class) {
550 return copyOf(((boolean[]) array));
551 }
552 if (array.getClass() == byte[].class) {
553 return copyOf(((byte[]) array));
554 }
555 if (array.getClass() == char[].class) {
556 return copyOf(((char[]) array));
557 }
558 if (array.getClass() == double[].class) {
559 return copyOf(((double[]) array));
560 }
561 if (array.getClass() == float[].class) {
562 return copyOf(((float[]) array));
563 }
564 if (array.getClass() == int[].class) {
565 return copyOf(((int[]) array));
566 }
567 if (array.getClass() == long[].class) {
568 return copyOf(((long[]) array));
569 }
570 if (array.getClass() == short[].class) {
571 return copyOf(((short[]) array));
572 }
573 final int len = Array.getLength(array);
574 final Object copy = Array.newInstance(array.getClass().getComponentType(), len);
575 for (int i = (len- 1); (i >= 0); i--) {
576 Array.set(copy, i, copyOfObject(Array.get(array, i)));
577 }
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-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
592 private static boolean[] copyOf(final boolean[] array) {
593 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
594 if (array!= null) {
595 final boolean[] copy = ((boolean[]) 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-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
611 private static byte[] copyOf(final byte[] array) {
612 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
613 if (array!= null) {
614 final byte[] copy = ((byte[]) 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-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
630 private static char[] copyOf(final char[] array) {
631 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
632 if (array!= null) {
633 final char[] copy = ((char[]) 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 array.
642 *
643 * @param array
644 * The array to copy or {@code null}.
645 * @return
646 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
647 */
648 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
649 private static double[] copyOf(final double[] array) {
650 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
651 if (array!= null) {
652 final double[] copy = ((double[]) Array.newInstance(array.getClass().getComponentType(), array.length));
653 System.arraycopy(array, 0, copy, 0, array.length);
654 return copy;
655 }
656 return null;
657 }
658
659 /**
660 * Creates and returns a deep copy of a given array.
661 *
662 * @param array
663 * The array to copy or {@code null}.
664 * @return
665 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
666 */
667 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
668 private static float[] copyOf(final float[] array) {
669 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
670 if (array!= null) {
671 final float[] copy = ((float[]) Array.newInstance(array.getClass().getComponentType(), array.length));
672 System.arraycopy(array, 0, copy, 0, array.length);
673 return copy;
674 }
675 return null;
676 }
677
678 /**
679 * Creates and returns a deep copy of a given array.
680 *
681 * @param array
682 * The array to copy or {@code null}.
683 * @return
684 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
685 */
686 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
687 private static int[] copyOf(final int[] array) {
688 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
689 if (array!= null) {
690 final int[] copy = ((int[]) Array.newInstance(array.getClass().getComponentType(), array.length));
691 System.arraycopy(array, 0, copy, 0, array.length);
692 return copy;
693 }
694 return null;
695 }
696
697 /**
698 * Creates and returns a deep copy of a given array.
699 *
700 * @param array
701 * The array to copy or {@code null}.
702 * @return
703 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
704 */
705 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
706 private static long[] copyOf(final long[] array) {
707 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
708 if (array!= null) {
709 final long[] copy = ((long[]) Array.newInstance(array.getClass().getComponentType(), array.length));
710 System.arraycopy(array, 0, copy, 0, array.length);
711 return copy;
712 }
713 return null;
714 }
715
716 /**
717 * Creates and returns a deep copy of a given array.
718 *
719 * @param array
720 * The array to copy or {@code null}.
721 * @return
722 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
723 */
724 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
725 private static short[] copyOf(final short[] array) {
726 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
727 if (array!= null) {
728 final short[] copy = ((short[]) Array.newInstance(array.getClass().getComponentType(), array.length));
729 System.arraycopy(array, 0, copy, 0, array.length);
730 return copy;
731 }
732 return null;
733 }
734
735 /**
736 * Creates and returns a deep copy of a given {@code JAXBElement} instance.
737 *
738 * @param element
739 * The instance to copy or {@code null}.
740 * @return
741 * A deep copy of {@code element} or {@code null} if {@code element} is {@code null}.
742 */
743 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
744 private static JAXBElement copyOFJAXBElement(final JAXBElement element) {
745 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
746 if (element!= null) {
747 final JAXBElement copy = new JAXBElement(element.getName(), element.getDeclaredType(), element.getScope(), element.getValue());
748 copy.setNil(element.isNil());
749 copy.setValue(copyOfObject(copy.getValue()));
750 return copy;
751 }
752 return null;
753 }
754
755 /**
756 * Creates and returns a deep copy of a given {@code Serializable}.
757 *
758 * @param serializable
759 * The instance to copy or {@code null}.
760 * @return
761 * A deep copy of {@code serializable} or {@code null} if {@code serializable} is {@code null}.
762 */
763 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
764 private static Serializable copyOfSerializable(final Serializable serializable) {
765 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
766 if (serializable!= null) {
767 try {
768 final ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream();
769 final ObjectOutputStream out = new ObjectOutputStream(byteArrayOutput);
770 out.writeObject(serializable);
771 out.close();
772 final ByteArrayInputStream byteArrayInput = new ByteArrayInputStream(byteArrayOutput.toByteArray());
773 final ObjectInputStream in = new ObjectInputStream(byteArrayInput);
774 final Serializable copy = ((Serializable) in.readObject());
775 in.close();
776 return copy;
777 } catch (SecurityException e) {
778 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
779 } catch (ClassNotFoundException e) {
780 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
781 } catch (InvalidClassException e) {
782 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
783 } catch (NotSerializableException e) {
784 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
785 } catch (StreamCorruptedException e) {
786 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
787 } catch (OptionalDataException e) {
788 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
789 } catch (IOException e) {
790 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
791 }
792 }
793 return null;
794 }
795
796 /**
797 * Creates and returns a deep copy of this object.
798 *
799 *
800 * @return
801 * A deep copy of this object.
802 */
803 @Override
804 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
805 public Specification clone() {
806 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
807 return new Specification(this);
808 }
809
810 }