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