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