001    //
002    // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 
003    // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
004    // Any modifications to this file will be lost upon recompilation of the source schema. 
005    // Generated on: 2009.10.04 at 12:50:46 AM UTC 
006    //
007    
008    
009    package org.jomc.model;
010    
011    import java.io.ByteArrayInputStream;
012    import java.io.ByteArrayOutputStream;
013    import java.io.IOException;
014    import java.io.InvalidClassException;
015    import java.io.NotSerializableException;
016    import java.io.ObjectInputStream;
017    import java.io.ObjectOutputStream;
018    import java.io.OptionalDataException;
019    import java.io.Serializable;
020    import java.io.StreamCorruptedException;
021    import java.lang.reflect.Array;
022    import java.lang.reflect.InvocationTargetException;
023    import java.math.BigDecimal;
024    import java.math.BigInteger;
025    import java.util.ArrayList;
026    import java.util.Calendar;
027    import java.util.Currency;
028    import java.util.Date;
029    import java.util.Iterator;
030    import java.util.List;
031    import java.util.Locale;
032    import java.util.TimeZone;
033    import java.util.UUID;
034    import javax.annotation.Generated;
035    import javax.xml.bind.JAXBElement;
036    import javax.xml.bind.annotation.XmlAccessType;
037    import javax.xml.bind.annotation.XmlAccessorType;
038    import javax.xml.bind.annotation.XmlAnyElement;
039    import javax.xml.bind.annotation.XmlAttribute;
040    import javax.xml.bind.annotation.XmlType;
041    import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
042    import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
043    import javax.xml.datatype.Duration;
044    import javax.xml.datatype.XMLGregorianCalendar;
045    import javax.xml.namespace.QName;
046    import org.w3c.dom.Element;
047    
048    
049    /**
050     * Model of an instance.
051     * <p>An instance consists of the properties {@code identifier},
052     * {@code implementationName}, {@code class} and {@code stateless}. Property
053     * {@code identifier} holds an identifier uniquely identifying the instance in a
054     * set of instances. Property {@code implementationName} holds a name uniquely
055     * identifying the instance for its specifications. Property {@code class} holds
056     * the class of an instance. The {@code stateless} flag indicates that the instance
057     * does not retain state across operations.</p>
058     * 
059     * <p>An instance is build from implementations. An implementation declaring a
060     * location declares its instance to be located outside the scope of the model.
061     * An implementation without a class is only available during implementation
062     * inheritance processing. No instance is build for such implementations. Instances
063     * have no relationship to the modules theire implementations are declared in.</p>
064     * 
065     * 
066     * 
067     */
068    @XmlAccessorType(XmlAccessType.FIELD)
069    @XmlType(name = "Instance", propOrder = {
070        "specifications",
071        "dependencies",
072        "properties",
073        "messages",
074        "any"
075    })
076    @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
077    public class Instance
078        extends ModelObject
079        implements Cloneable
080    {
081    
082        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
083        protected Specifications specifications;
084        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
085        protected Dependencies dependencies;
086        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
087        protected Properties properties;
088        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
089        protected Messages messages;
090        @XmlAnyElement(lax = true)
091        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
092        protected List<Object> any;
093        @XmlAttribute(required = true)
094        @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
095        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
096        protected String identifier;
097        @XmlAttribute(required = true)
098        @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
099        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
100        protected String implementationName;
101        @XmlAttribute(name = "class", required = true)
102        @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
103        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
104        protected String clazz;
105        @XmlAttribute
106        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
107        protected Boolean stateless;
108    
109        /**
110         * Creates a new {@code Instance} instance.
111         * 
112         */
113        public Instance() {
114             // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
115            super();
116        }
117    
118        /**
119         * Creates a new {@code Instance} instance by deeply copying a given instance.
120         * 
121         * @param o
122         *     The instance to copy or {@code null}.
123         */
124        public Instance(final Instance o) {
125             // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
126            super(o);
127            if (o!= null) {
128                {
129                    // CClassInfo: org.jomc.model.Specifications
130                    this.specifications = ((((Specifications) o.getSpecifications()) == null)?null:((Specifications) o.getSpecifications()).clone());
131                    // CClassInfo: org.jomc.model.Dependencies
132                    this.dependencies = ((((Dependencies) o.getDependencies()) == null)?null:((Dependencies) o.getDependencies()).clone());
133                    // CClassInfo: org.jomc.model.Properties
134                    this.properties = ((((Properties) o.getProperties()) == null)?null:((Properties) o.getProperties()).clone());
135                    // CClassInfo: org.jomc.model.Messages
136                    this.messages = ((((Messages) o.getMessages()) == null)?null:((Messages) o.getMessages()).clone());
137                    // 'Any' collection.
138                    copyAny(o.getAny(), getAny());
139                    // CBuiltinLeafInfo: java.lang.String
140                    this.identifier = ((String) o.getIdentifier());
141                    // CBuiltinLeafInfo: java.lang.String
142                    this.implementationName = ((String) o.getImplementationName());
143                    // CBuiltinLeafInfo: java.lang.String
144                    this.clazz = ((String) o.getClazz());
145                    // CBuiltinLeafInfo: java.lang.Boolean
146                    this.stateless = ((Boolean) o.isStateless());
147                }
148            }
149        }
150    
151        /**
152         * Specifications of this instance or {@code null}.
153         * 
154         * @return
155         *     possible object is
156         *     {@link Specifications }
157         *     
158         */
159        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
160        public Specifications getSpecifications() {
161            return specifications;
162        }
163    
164        /**
165         * Sets the value of the specifications property.
166         * 
167         * @param value
168         *     allowed object is
169         *     {@link Specifications }
170         *     
171         */
172        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
173        public void setSpecifications(Specifications value) {
174            this.specifications = value;
175        }
176    
177        /**
178         * Dependencies of this instance or {@code null}.
179         * 
180         * @return
181         *     possible object is
182         *     {@link Dependencies }
183         *     
184         */
185        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
186        public Dependencies getDependencies() {
187            return dependencies;
188        }
189    
190        /**
191         * Sets the value of the dependencies property.
192         * 
193         * @param value
194         *     allowed object is
195         *     {@link Dependencies }
196         *     
197         */
198        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
199        public void setDependencies(Dependencies value) {
200            this.dependencies = value;
201        }
202    
203        /**
204         * Properties of this instance or {@code null}.
205         * 
206         * @return
207         *     possible object is
208         *     {@link Properties }
209         *     
210         */
211        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
212        public Properties getProperties() {
213            return properties;
214        }
215    
216        /**
217         * Sets the value of the properties property.
218         * 
219         * @param value
220         *     allowed object is
221         *     {@link Properties }
222         *     
223         */
224        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
225        public void setProperties(Properties value) {
226            this.properties = value;
227        }
228    
229        /**
230         * Messages of this instance or {@code null}.
231         * 
232         * @return
233         *     possible object is
234         *     {@link Messages }
235         *     
236         */
237        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
238        public Messages getMessages() {
239            return messages;
240        }
241    
242        /**
243         * Sets the value of the messages property.
244         * 
245         * @param value
246         *     allowed object is
247         *     {@link Messages }
248         *     
249         */
250        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
251        public void setMessages(Messages value) {
252            this.messages = value;
253        }
254    
255        /**
256         * Gets the value of the any property.
257         * 
258         * <p>
259         * This accessor method returns a reference to the live list,
260         * not a snapshot. Therefore any modification you make to the
261         * returned list will be present inside the JAXB object.
262         * This is why there is not a <CODE>set</CODE> method for the any property.
263         * 
264         * <p>
265         * For example, to add a new item, do as follows:
266         * <pre>
267         *    getAny().add(newItem);
268         * </pre>
269         * 
270         * 
271         * <p>
272         * Objects of the following type(s) are allowed in the list
273         * {@link Object }
274         * {@link Element }
275         * 
276         * 
277         */
278        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
279        public List<Object> getAny() {
280            if (any == null) {
281                any = new ArrayList<Object>();
282            }
283            return this.any;
284        }
285    
286        /**
287         * The identifier of this instance.
288         * 
289         * @return
290         *     possible object is
291         *     {@link String }
292         *     
293         */
294        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
295        public String getIdentifier() {
296            return identifier;
297        }
298    
299        /**
300         * Sets the value of the identifier property.
301         * 
302         * @param value
303         *     allowed object is
304         *     {@link String }
305         *     
306         */
307        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
308        public void setIdentifier(String value) {
309            this.identifier = value;
310        }
311    
312        /**
313         * The name of the implementation of this instance.
314         * 
315         * @return
316         *     possible object is
317         *     {@link String }
318         *     
319         */
320        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
321        public String getImplementationName() {
322            return implementationName;
323        }
324    
325        /**
326         * Sets the value of the implementationName property.
327         * 
328         * @param value
329         *     allowed object is
330         *     {@link String }
331         *     
332         */
333        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
334        public void setImplementationName(String value) {
335            this.implementationName = value;
336        }
337    
338        /**
339         * The class of this instance.
340         * 
341         * @return
342         *     possible object is
343         *     {@link String }
344         *     
345         */
346        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
347        public String getClazz() {
348            return clazz;
349        }
350    
351        /**
352         * Sets the value of the clazz property.
353         * 
354         * @param value
355         *     allowed object is
356         *     {@link String }
357         *     
358         */
359        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
360        public void setClazz(String value) {
361            this.clazz = value;
362        }
363    
364        /**
365         * Flags this instance stateless.
366         * 
367         * @return
368         *     possible object is
369         *     {@link Boolean }
370         *     
371         */
372        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
373        public boolean isStateless() {
374            if (stateless == null) {
375                return false;
376            } else {
377                return stateless;
378            }
379        }
380    
381        /**
382         * Sets the value of the stateless property.
383         * 
384         * @param value
385         *     allowed object is
386         *     {@link Boolean }
387         *     
388         */
389        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
390        public void setStateless(Boolean value) {
391            this.stateless = value;
392        }
393    
394        /**
395         * Copies all values of property {@code Any} deeply.
396         * 
397         * @param target
398         *     The target to copy {@code source} to.
399         * @param source
400         *     The source to copy from.
401         * @throws NullPointerException
402         *     if {@code source} or {@code target} is {@code null}.
403         */
404        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
405        private static void copyAny(final List<Object> source, final List<Object> target) {
406            // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
407            if (!source.isEmpty()) {
408                for (Iterator it = source.iterator(); it.hasNext(); ) {
409                    final Object next = it.next();
410                    if (next instanceof Element) {
411                        // CWildcardTypeInfo: org.w3c.dom.Element
412                        target.add(((Element)((Element) next).cloneNode(true)));
413                        continue;
414                    }
415                    if (next instanceof Object) {
416                        // CBuiltinLeafInfo: java.lang.Object
417                        target.add(copyOfObject(((Object) next)));
418                        continue;
419                    }
420                    // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
421                    throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Any' of class 'org.jomc.model.Instance'."));
422                }
423            }
424        }
425    
426        /**
427         * Creates and returns a deep copy of a given object.
428         * 
429         * @param o
430         *     The instance to copy or {@code null}.
431         * @return
432         *     A deep copy of {@code o} or {@code null} if {@code o} is {@code null}.
433         */
434        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
435        private static Object copyOfObject(final Object o) {
436            // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
437            if (o!= null) {
438                if (o.getClass().isPrimitive()) {
439                    return o;
440                }
441                if (o.getClass().isArray()) {
442                    return copyOfArray(o);
443                }
444                if (o instanceof Boolean) {
445                    return o;
446                }
447                if (o instanceof Byte) {
448                    return o;
449                }
450                if (o instanceof Character) {
451                    return o;
452                }
453                if (o instanceof Double) {
454                    return o;
455                }
456                if (o instanceof Enum) {
457                    return o;
458                }
459                if (o instanceof Float) {
460                    return o;
461                }
462                if (o instanceof Integer) {
463                    return o;
464                }
465                if (o instanceof Long) {
466                    return o;
467                }
468                if (o instanceof Short) {
469                    return o;
470                }
471                if (o instanceof String) {
472                    return o;
473                }
474                if (o instanceof BigDecimal) {
475                    return o;
476                }
477                if (o instanceof BigInteger) {
478                    return o;
479                }
480                if (o instanceof UUID) {
481                    return o;
482                }
483                if (o instanceof QName) {
484                    return o;
485                }
486                if (o instanceof Duration) {
487                    return o;
488                }
489                if (o instanceof Currency) {
490                    return o;
491                }
492                if (o instanceof XMLGregorianCalendar) {
493                    return ((XMLGregorianCalendar) o).clone();
494                }
495                if (o instanceof Date) {
496                    return ((Date) o).clone();
497                }
498                if (o instanceof Calendar) {
499                    return ((Calendar) o).clone();
500                }
501                if (o instanceof TimeZone) {
502                    return ((TimeZone) o).clone();
503                }
504                if (o instanceof Locale) {
505                    return ((Locale) o).clone();
506                }
507                if (o instanceof Element) {
508                    return ((Element)((Element) o).cloneNode(true));
509                }
510                if (o instanceof JAXBElement) {
511                    return copyOFJAXBElement(((JAXBElement) o));
512                }
513                try {
514                    return o.getClass().getMethod("clone", ((Class[]) null)).invoke(o, ((Object[]) null));
515                } catch (NoSuchMethodException e) {
516                    if (o instanceof Serializable) {
517                        return copyOfSerializable(((Serializable) o));
518                    }
519                    // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
520                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
521                } catch (IllegalAccessException e) {
522                    // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
523                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
524                } catch (InvocationTargetException e) {
525                    // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
526                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
527                } catch (SecurityException e) {
528                    // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
529                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
530                } catch (IllegalArgumentException e) {
531                    // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
532                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
533                } catch (ExceptionInInitializerError e) {
534                    // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
535                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
536                }
537            }
538            return null;
539        }
540    
541        /**
542         * Creates and returns a deep copy of a given array.
543         * 
544         * @param array
545         *     The array to copy or {@code null}.
546         * @return
547         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
548         */
549        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
550        private static Object copyOfArray(final Object array) {
551            // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
552            if (array!= null) {
553                if (array.getClass() == boolean[].class) {
554                    return copyOf(((boolean[]) array));
555                }
556                if (array.getClass() == byte[].class) {
557                    return copyOf(((byte[]) array));
558                }
559                if (array.getClass() == char[].class) {
560                    return copyOf(((char[]) array));
561                }
562                if (array.getClass() == double[].class) {
563                    return copyOf(((double[]) array));
564                }
565                if (array.getClass() == float[].class) {
566                    return copyOf(((float[]) array));
567                }
568                if (array.getClass() == int[].class) {
569                    return copyOf(((int[]) array));
570                }
571                if (array.getClass() == long[].class) {
572                    return copyOf(((long[]) array));
573                }
574                if (array.getClass() == short[].class) {
575                    return copyOf(((short[]) array));
576                }
577                final int len = Array.getLength(array);
578                final Object copy = Array.newInstance(array.getClass().getComponentType(), len);
579                for (int i = (len- 1); (i >= 0); i--) {
580                    Array.set(copy, i, copyOfObject(Array.get(array, i)));
581                }
582                return copy;
583            }
584            return null;
585        }
586    
587        /**
588         * Creates and returns a deep copy of a given array.
589         * 
590         * @param array
591         *     The array to copy or {@code null}.
592         * @return
593         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
594         */
595        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
596        private static boolean[] copyOf(final boolean[] array) {
597            // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
598            if (array!= null) {
599                final boolean[] copy = ((boolean[]) Array.newInstance(array.getClass().getComponentType(), array.length));
600                System.arraycopy(array, 0, copy, 0, array.length);
601                return copy;
602            }
603            return null;
604        }
605    
606        /**
607         * Creates and returns a deep copy of a given array.
608         * 
609         * @param array
610         *     The array to copy or {@code null}.
611         * @return
612         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
613         */
614        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
615        private static byte[] copyOf(final byte[] array) {
616            // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
617            if (array!= null) {
618                final byte[] copy = ((byte[]) Array.newInstance(array.getClass().getComponentType(), array.length));
619                System.arraycopy(array, 0, copy, 0, array.length);
620                return copy;
621            }
622            return null;
623        }
624    
625        /**
626         * Creates and returns a deep copy of a given array.
627         * 
628         * @param array
629         *     The array to copy or {@code null}.
630         * @return
631         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
632         */
633        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
634        private static char[] copyOf(final char[] array) {
635            // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
636            if (array!= null) {
637                final char[] copy = ((char[]) Array.newInstance(array.getClass().getComponentType(), array.length));
638                System.arraycopy(array, 0, copy, 0, array.length);
639                return copy;
640            }
641            return null;
642        }
643    
644        /**
645         * Creates and returns a deep copy of a given array.
646         * 
647         * @param array
648         *     The array to copy or {@code null}.
649         * @return
650         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
651         */
652        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
653        private static double[] copyOf(final double[] array) {
654            // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
655            if (array!= null) {
656                final double[] copy = ((double[]) Array.newInstance(array.getClass().getComponentType(), array.length));
657                System.arraycopy(array, 0, copy, 0, array.length);
658                return copy;
659            }
660            return null;
661        }
662    
663        /**
664         * Creates and returns a deep copy of a given array.
665         * 
666         * @param array
667         *     The array to copy or {@code null}.
668         * @return
669         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
670         */
671        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
672        private static float[] copyOf(final float[] array) {
673            // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
674            if (array!= null) {
675                final float[] copy = ((float[]) Array.newInstance(array.getClass().getComponentType(), array.length));
676                System.arraycopy(array, 0, copy, 0, array.length);
677                return copy;
678            }
679            return null;
680        }
681    
682        /**
683         * Creates and returns a deep copy of a given array.
684         * 
685         * @param array
686         *     The array to copy or {@code null}.
687         * @return
688         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
689         */
690        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
691        private static int[] copyOf(final int[] array) {
692            // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
693            if (array!= null) {
694                final int[] copy = ((int[]) Array.newInstance(array.getClass().getComponentType(), array.length));
695                System.arraycopy(array, 0, copy, 0, array.length);
696                return copy;
697            }
698            return null;
699        }
700    
701        /**
702         * Creates and returns a deep copy of a given array.
703         * 
704         * @param array
705         *     The array to copy or {@code null}.
706         * @return
707         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
708         */
709        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
710        private static long[] copyOf(final long[] array) {
711            // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
712            if (array!= null) {
713                final long[] copy = ((long[]) Array.newInstance(array.getClass().getComponentType(), array.length));
714                System.arraycopy(array, 0, copy, 0, array.length);
715                return copy;
716            }
717            return null;
718        }
719    
720        /**
721         * Creates and returns a deep copy of a given array.
722         * 
723         * @param array
724         *     The array to copy or {@code null}.
725         * @return
726         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
727         */
728        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
729        private static short[] copyOf(final short[] array) {
730            // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
731            if (array!= null) {
732                final short[] copy = ((short[]) Array.newInstance(array.getClass().getComponentType(), array.length));
733                System.arraycopy(array, 0, copy, 0, array.length);
734                return copy;
735            }
736            return null;
737        }
738    
739        /**
740         * Creates and returns a deep copy of a given {@code JAXBElement} instance.
741         * 
742         * @param element
743         *     The instance to copy or {@code null}.
744         * @return
745         *     A deep copy of {@code element} or {@code null} if {@code element} is {@code null}.
746         */
747        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
748        private static JAXBElement copyOFJAXBElement(final JAXBElement element) {
749            // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
750            if (element!= null) {
751                final JAXBElement copy = new JAXBElement(element.getName(), element.getDeclaredType(), element.getScope(), element.getValue());
752                copy.setNil(element.isNil());
753                copy.setValue(copyOfObject(copy.getValue()));
754                return copy;
755            }
756            return null;
757        }
758    
759        /**
760         * Creates and returns a deep copy of a given {@code Serializable}.
761         * 
762         * @param serializable
763         *     The instance to copy or {@code null}.
764         * @return
765         *     A deep copy of {@code serializable} or {@code null} if {@code serializable} is {@code null}.
766         */
767        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
768        private static Serializable copyOfSerializable(final Serializable serializable) {
769            // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
770            if (serializable!= null) {
771                try {
772                    final ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream();
773                    final ObjectOutputStream out = new ObjectOutputStream(byteArrayOutput);
774                    out.writeObject(serializable);
775                    out.close();
776                    final ByteArrayInputStream byteArrayInput = new ByteArrayInputStream(byteArrayOutput.toByteArray());
777                    final ObjectInputStream in = new ObjectInputStream(byteArrayInput);
778                    final Serializable copy = ((Serializable) in.readObject());
779                    in.close();
780                    return copy;
781                } catch (SecurityException e) {
782                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
783                } catch (ClassNotFoundException e) {
784                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
785                } catch (InvalidClassException e) {
786                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
787                } catch (NotSerializableException e) {
788                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
789                } catch (StreamCorruptedException e) {
790                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
791                } catch (OptionalDataException e) {
792                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
793                } catch (IOException e) {
794                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
795                }
796            }
797            return null;
798        }
799    
800        /**
801         * Creates and returns a deep copy of this object.
802         * 
803         * 
804         * @return
805         *     A deep copy of this object.
806         */
807        @Override
808        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
809        public Instance clone() {
810             // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
811            return new Instance(this);
812        }
813        
814        /** Maps dependency names to dependency objects. */
815        @javax.xml.bind.annotation.XmlTransient private java.util.Map<String, Object> dependencyObjects;
816    
817        /** Maps property names to property objects. */
818        @javax.xml.bind.annotation.XmlTransient private java.util.Map<String, Object> propertyObjects;
819    
820        /** The classloader of the instance. */
821        @javax.xml.bind.annotation.XmlTransient private ClassLoader classLoader;
822    
823        /**
824         * Gets the classloader of the instance.
825         *
826         * @return The classloader of the instance.
827         */
828        public ClassLoader getClassLoader()
829        {
830            return this.classLoader;
831        }
832    
833        /**
834         * Sets the classloader of the instance.
835         *
836         * @param value The new classloader of the instance.
837         */
838        public void setClassLoader( final ClassLoader value )
839        {
840            this.classLoader = value;
841        }
842    
843        /**
844         * Gets a mapping of dependency names to objects bound to the instance.
845         *
846         * @return A mapping of dependency names to objects bound to the instance.
847         */
848        public java.util.Map<String, Object> getDependencyObjects()
849        {
850            if ( this.dependencyObjects == null )
851            {
852                this.dependencyObjects = new java.util.HashMap<String, Object>();
853            }
854    
855            return this.dependencyObjects;
856        }
857    
858        /**
859         * Gets a mapping of property names to objects bound to the instance.
860         *
861         * @return A mapping of property names to objects bound to the instance.
862         */
863        public java.util.Map<String, Object> getPropertyObjects()
864        {
865            if ( this.propertyObjects == null )
866            {
867                this.propertyObjects = new java.util.HashMap<String, Object>();
868            }
869    
870            return this.propertyObjects;
871        }
872    
873          
874    }