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.XmlSchemaType;
041    import javax.xml.bind.annotation.XmlType;
042    import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
043    import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
044    import javax.xml.datatype.Duration;
045    import javax.xml.datatype.XMLGregorianCalendar;
046    import javax.xml.namespace.QName;
047    import org.w3c.dom.Element;
048    
049    
050    /**
051     * Model of an implementation.
052     * <p>An implementation consists of the properties {@code identifier}, {@code name},
053     * {@code class}, {@code location}, {@code description}, {@code vendor} and
054     * {@code version}. Property {@code identifier} holds an identifier uniquely
055     * identifying the implementation in a set of implementations. Property
056     * {@code name} holds a name of the implementation uniquely identifying the
057     * implementation for its specifications. Property {@code class} holds the name of
058     * the class providing implementation instances. Property {@code location} holds an
059     * URI of the location of instances of the implementation. Property
060     * {@code description} holds a textual description. Property {@code vendor} holds
061     * vendor information for the vendor providing the implementation. Property
062     * {@code version} holds a textual version of the implementation.</p>
063     * 
064     * <p>Dependencies, messages, properties and specifications may be inherited from
065     * multiple parent implementations. Property {@code final} flags an implementation
066     * the final node in an inheritance hierarchy.</p>
067     * 
068     * <p>The {@code stateless} flag indicates that instances of the implementation
069     * do not retain state across operations.</p>
070     * 
071     * 
072     * 
073     */
074    @XmlAccessorType(XmlAccessType.FIELD)
075    @XmlType(name = "Implementation", propOrder = {
076        "specifications",
077        "implementations",
078        "dependencies",
079        "properties",
080        "messages",
081        "any"
082    })
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    public class Implementation
085        extends ModelObject
086        implements Cloneable
087    {
088    
089        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
090        protected Specifications specifications;
091        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
092        protected Implementations implementations;
093        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
094        protected Dependencies dependencies;
095        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
096        protected Properties properties;
097        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
098        protected Messages messages;
099        @XmlAnyElement(lax = true)
100        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
101        protected List<Object> any;
102        @XmlAttribute(required = true)
103        @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
104        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
105        protected String identifier;
106        @XmlAttribute(required = true)
107        @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
108        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
109        protected String name;
110        @XmlAttribute(name = "class")
111        @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
112        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
113        protected String clazz;
114        @XmlAttribute
115        @XmlSchemaType(name = "anyURI")
116        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
117        protected String location;
118        @XmlAttribute
119        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
120        protected String vendor;
121        @XmlAttribute
122        @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
123        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
124        protected String version;
125        @XmlAttribute(name = "final")
126        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
127        protected Boolean _final;
128        @XmlAttribute
129        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
130        protected Boolean stateless;
131        @XmlAttribute(name = "abstract")
132        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
133        protected Boolean _abstract;
134    
135        /**
136         * Creates a new {@code Implementation} instance.
137         * 
138         */
139        public Implementation() {
140            // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
141            super();
142        }
143    
144        /**
145         * Creates a new {@code Implementation} instance by deeply copying a given {@code Implementation} instance.
146         * 
147         * 
148         * @param o
149         *     The instance to copy.
150         * @throws NullPointerException
151         *     if {@code o} is {@code null}.
152         */
153        public Implementation(final Implementation o) {
154            // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
155            super(o);
156            if (o == null) {
157                throw new NullPointerException("Cannot create a copy of 'Implementation' from 'null'.");
158            }
159            // CClassInfo: org.jomc.model.Specifications
160            this.specifications = ((o.getSpecifications() == null)?null:o.getSpecifications().clone());
161            // CClassInfo: org.jomc.model.Implementations
162            this.implementations = ((o.getImplementations() == null)?null:o.getImplementations().clone());
163            // CClassInfo: org.jomc.model.Dependencies
164            this.dependencies = ((o.getDependencies() == null)?null:o.getDependencies().clone());
165            // CClassInfo: org.jomc.model.Properties
166            this.properties = ((o.getProperties() == null)?null:o.getProperties().clone());
167            // CClassInfo: org.jomc.model.Messages
168            this.messages = ((o.getMessages() == null)?null:o.getMessages().clone());
169            // 'Any' collection.
170            copyAny(o.getAny(), getAny());
171            // CBuiltinLeafInfo: java.lang.String
172            this.identifier = o.getIdentifier();
173            // CBuiltinLeafInfo: java.lang.String
174            this.name = o.getName();
175            // CBuiltinLeafInfo: java.lang.String
176            this.clazz = o.getClazz();
177            // CBuiltinLeafInfo: java.lang.String
178            this.location = o.getLocation();
179            // CBuiltinLeafInfo: java.lang.String
180            this.vendor = o.getVendor();
181            // CBuiltinLeafInfo: java.lang.String
182            this.version = o.getVersion();
183            // CBuiltinLeafInfo: java.lang.Boolean
184            this._final = o.isFinal();
185            // CBuiltinLeafInfo: java.lang.Boolean
186            this.stateless = o.isStateless();
187            // CBuiltinLeafInfo: java.lang.Boolean
188            this._abstract = o.isAbstract();
189        }
190    
191        /**
192         * References to specifications implemented by this implementation or {@code null}.
193         * 
194         * @return
195         *     possible object is
196         *     {@link Specifications }
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 Specifications getSpecifications() {
201            return specifications;
202        }
203    
204        /**
205         * Sets the value of the specifications property.
206         * 
207         * @param value
208         *     allowed object is
209         *     {@link Specifications }
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 void setSpecifications(Specifications value) {
214            this.specifications = value;
215        }
216    
217        /**
218         * References to implementations this implementation inherits from or {@code null}.
219         * 
220         * @return
221         *     possible object is
222         *     {@link Implementations }
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 Implementations getImplementations() {
227            return implementations;
228        }
229    
230        /**
231         * Sets the value of the implementations property.
232         * 
233         * @param value
234         *     allowed object is
235         *     {@link Implementations }
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 void setImplementations(Implementations value) {
240            this.implementations = value;
241        }
242    
243        /**
244         * Dependencies of this implementation or {@code null}.
245         * 
246         * @return
247         *     possible object is
248         *     {@link Dependencies }
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 Dependencies getDependencies() {
253            return dependencies;
254        }
255    
256        /**
257         * Sets the value of the dependencies property.
258         * 
259         * @param value
260         *     allowed object is
261         *     {@link Dependencies }
262         *     
263         */
264        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
265        public void setDependencies(Dependencies value) {
266            this.dependencies = value;
267        }
268    
269        /**
270         * Properties of this implementation or {@code null}.
271         * 
272         * @return
273         *     possible object is
274         *     {@link Properties }
275         *     
276         */
277        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
278        public Properties getProperties() {
279            return properties;
280        }
281    
282        /**
283         * Sets the value of the properties property.
284         * 
285         * @param value
286         *     allowed object is
287         *     {@link Properties }
288         *     
289         */
290        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
291        public void setProperties(Properties value) {
292            this.properties = value;
293        }
294    
295        /**
296         * Messages of this implementation or {@code null}.
297         * 
298         * @return
299         *     possible object is
300         *     {@link Messages }
301         *     
302         */
303        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
304        public Messages getMessages() {
305            return messages;
306        }
307    
308        /**
309         * Sets the value of the messages property.
310         * 
311         * @param value
312         *     allowed object is
313         *     {@link Messages }
314         *     
315         */
316        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
317        public void setMessages(Messages value) {
318            this.messages = value;
319        }
320    
321        /**
322         * Gets the value of the any property.
323         * 
324         * <p>
325         * This accessor method returns a reference to the live list,
326         * not a snapshot. Therefore any modification you make to the
327         * returned list will be present inside the JAXB object.
328         * This is why there is not a <CODE>set</CODE> method for the any property.
329         * 
330         * <p>
331         * For example, to add a new item, do as follows:
332         * <pre>
333         *    getAny().add(newItem);
334         * </pre>
335         * 
336         * 
337         * <p>
338         * Objects of the following type(s) are allowed in the list
339         * {@link Element }
340         * {@link Object }
341         * 
342         * 
343         */
344        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
345        public List<Object> getAny() {
346            if (any == null) {
347                any = new ArrayList<Object>();
348            }
349            return this.any;
350        }
351    
352        /**
353         * The identifier of this implementation.
354         * 
355         * @return
356         *     possible 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 String getIdentifier() {
362            return identifier;
363        }
364    
365        /**
366         * Sets the value of the identifier property.
367         * 
368         * @param value
369         *     allowed object is
370         *     {@link String }
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 void setIdentifier(String value) {
375            this.identifier = value;
376        }
377    
378        /**
379         * The name of this implementation.
380         * 
381         * @return
382         *     possible object is
383         *     {@link String }
384         *     
385         */
386        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
387        public String getName() {
388            return name;
389        }
390    
391        /**
392         * Sets the value of the name property.
393         * 
394         * @param value
395         *     allowed object is
396         *     {@link String }
397         *     
398         */
399        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
400        public void setName(String value) {
401            this.name = value;
402        }
403    
404        /**
405         * The name of the class providing instances of this implementation or {@code null}.
406         * 
407         * @return
408         *     possible object is
409         *     {@link String }
410         *     
411         */
412        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
413        public String getClazz() {
414            return clazz;
415        }
416    
417        /**
418         * Sets the value of the clazz property.
419         * 
420         * @param value
421         *     allowed object is
422         *     {@link String }
423         *     
424         */
425        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
426        public void setClazz(String value) {
427            this.clazz = value;
428        }
429    
430        /**
431         * An URI of the location providing instances of this implementation or {@code null}.
432         * 
433         * @return
434         *     possible object is
435         *     {@link String }
436         *     
437         */
438        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
439        public String getLocation() {
440            return location;
441        }
442    
443        /**
444         * Sets the value of the location property.
445         * 
446         * @param value
447         *     allowed object is
448         *     {@link String }
449         *     
450         */
451        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
452        public void setLocation(String value) {
453            this.location = value;
454        }
455    
456        /**
457         * The presentation vendor of this implementation or {@code null}.
458         * 
459         * @return
460         *     possible object is
461         *     {@link String }
462         *     
463         */
464        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
465        public String getVendor() {
466            return vendor;
467        }
468    
469        /**
470         * Sets the value of the vendor property.
471         * 
472         * @param value
473         *     allowed object is
474         *     {@link String }
475         *     
476         */
477        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
478        public void setVendor(String value) {
479            this.vendor = value;
480        }
481    
482        /**
483         * The version of this implementation or {@code null}.
484         * 
485         * @return
486         *     possible object is
487         *     {@link String }
488         *     
489         */
490        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
491        public String getVersion() {
492            return version;
493        }
494    
495        /**
496         * Sets the value of the version property.
497         * 
498         * @param value
499         *     allowed object is
500         *     {@link String }
501         *     
502         */
503        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
504        public void setVersion(String value) {
505            this.version = value;
506        }
507    
508        /**
509         * Flags this implementation the final node in an inheritance hierarchy.
510         * 
511         * @return
512         *     possible object is
513         *     {@link Boolean }
514         *     
515         */
516        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
517        public boolean isFinal() {
518            if (_final == null) {
519                return false;
520            } else {
521                return _final;
522            }
523        }
524    
525        /**
526         * Sets the value of the final property.
527         * 
528         * @param value
529         *     allowed object is
530         *     {@link Boolean }
531         *     
532         */
533        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
534        public void setFinal(Boolean value) {
535            this._final = value;
536        }
537    
538        /**
539         * Flags this implementation stateless.
540         * 
541         * @return
542         *     possible object is
543         *     {@link Boolean }
544         *     
545         */
546        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
547        public boolean isStateless() {
548            if (stateless == null) {
549                return false;
550            } else {
551                return stateless;
552            }
553        }
554    
555        /**
556         * Sets the value of the stateless property.
557         * 
558         * @param value
559         *     allowed object is
560         *     {@link Boolean }
561         *     
562         */
563        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
564        public void setStateless(Boolean value) {
565            this.stateless = value;
566        }
567    
568        /**
569         * Flags this implementation abstract.
570         * 
571         * @return
572         *     possible object is
573         *     {@link Boolean }
574         *     
575         */
576        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
577        public boolean isAbstract() {
578            if (_abstract == null) {
579                return false;
580            } else {
581                return _abstract;
582            }
583        }
584    
585        /**
586         * Sets the value of the abstract property.
587         * 
588         * @param value
589         *     allowed object is
590         *     {@link Boolean }
591         *     
592         */
593        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
594        public void setAbstract(Boolean value) {
595            this._abstract = value;
596        }
597    
598        /**
599         * Copies all values of property {@code Any} deeply.
600         * 
601         * @param target
602         *     The target to copy {@code source} to.
603         * @param source
604         *     The source to copy from.
605         * @throws NullPointerException
606         *     if {@code source} or {@code target} is {@code null}.
607         */
608        @SuppressWarnings("unchecked")
609        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
610        private static void copyAny(final List<Object> source, final List<Object> target) {
611            // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
612            if (!source.isEmpty()) {
613                for (Iterator it = source.iterator(); it.hasNext(); ) {
614                    final Object next = it.next();
615                    if (next instanceof Element) {
616                        // CWildcardTypeInfo: org.w3c.dom.Element
617                        target.add(((Element)((Element) next).cloneNode(true)));
618                        continue;
619                    }
620                    if (next instanceof Object) {
621                        // CBuiltinLeafInfo: java.lang.Object
622                        target.add(copyOfObject(((Object) next)));
623                        continue;
624                    }
625                    // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
626                    throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Any' of class 'org.jomc.model.Implementation'."));
627                }
628            }
629        }
630    
631        /**
632         * Creates and returns a deep copy of a given object.
633         * 
634         * @param o
635         *     The instance to copy or {@code null}.
636         * @return
637         *     A deep copy of {@code o} or {@code null} if {@code o} is {@code null}.
638         */
639        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
640        private static Object copyOfObject(final Object o) {
641            // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
642            if (o!= null) {
643                if (o.getClass().isPrimitive()) {
644                    return o;
645                }
646                if (o.getClass().isArray()) {
647                    return copyOfArray(o);
648                }
649                if (o instanceof Boolean) {
650                    return o;
651                }
652                if (o instanceof Byte) {
653                    return o;
654                }
655                if (o instanceof Character) {
656                    return o;
657                }
658                if (o instanceof Double) {
659                    return o;
660                }
661                if (o instanceof Enum) {
662                    return o;
663                }
664                if (o instanceof Float) {
665                    return o;
666                }
667                if (o instanceof Integer) {
668                    return o;
669                }
670                if (o instanceof Long) {
671                    return o;
672                }
673                if (o instanceof Short) {
674                    return o;
675                }
676                if (o instanceof String) {
677                    return o;
678                }
679                if (o instanceof BigDecimal) {
680                    return o;
681                }
682                if (o instanceof BigInteger) {
683                    return o;
684                }
685                if (o instanceof UUID) {
686                    return o;
687                }
688                if (o instanceof QName) {
689                    return o;
690                }
691                if (o instanceof Duration) {
692                    return o;
693                }
694                if (o instanceof Currency) {
695                    return o;
696                }
697                if (o instanceof XMLGregorianCalendar) {
698                    return ((XMLGregorianCalendar) o).clone();
699                }
700                if (o instanceof Date) {
701                    return ((Date) o).clone();
702                }
703                if (o instanceof Calendar) {
704                    return ((Calendar) o).clone();
705                }
706                if (o instanceof TimeZone) {
707                    return ((TimeZone) o).clone();
708                }
709                if (o instanceof Locale) {
710                    return ((Locale) o).clone();
711                }
712                if (o instanceof Element) {
713                    return ((Element)((Element) o).cloneNode(true));
714                }
715                if (o instanceof JAXBElement) {
716                    return copyOFJAXBElement(((JAXBElement) o));
717                }
718                try {
719                    return o.getClass().getMethod("clone", ((Class[]) null)).invoke(o, ((Object[]) null));
720                } catch (NoSuchMethodException e) {
721                    if (o instanceof Serializable) {
722                        return copyOfSerializable(((Serializable) o));
723                    }
724                    // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
725                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
726                } catch (IllegalAccessException e) {
727                    // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
728                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
729                } catch (InvocationTargetException e) {
730                    // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
731                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
732                } catch (SecurityException e) {
733                    // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
734                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
735                } catch (IllegalArgumentException e) {
736                    // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
737                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
738                } catch (ExceptionInInitializerError e) {
739                    // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
740                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
741                }
742            }
743            return null;
744        }
745    
746        /**
747         * Creates and returns a deep copy of a given array.
748         * 
749         * @param array
750         *     The array to copy or {@code null}.
751         * @return
752         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
753         */
754        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
755        private static Object copyOfArray(final Object array) {
756            // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
757            if (array!= null) {
758                if (array.getClass() == boolean[].class) {
759                    return copyOf(((boolean[]) array));
760                }
761                if (array.getClass() == byte[].class) {
762                    return copyOf(((byte[]) array));
763                }
764                if (array.getClass() == char[].class) {
765                    return copyOf(((char[]) array));
766                }
767                if (array.getClass() == double[].class) {
768                    return copyOf(((double[]) array));
769                }
770                if (array.getClass() == float[].class) {
771                    return copyOf(((float[]) array));
772                }
773                if (array.getClass() == int[].class) {
774                    return copyOf(((int[]) array));
775                }
776                if (array.getClass() == long[].class) {
777                    return copyOf(((long[]) array));
778                }
779                if (array.getClass() == short[].class) {
780                    return copyOf(((short[]) array));
781                }
782                final int len = Array.getLength(array);
783                final Object copy = Array.newInstance(array.getClass().getComponentType(), len);
784                for (int i = (len- 1); (i >= 0); i--) {
785                    Array.set(copy, i, copyOfObject(Array.get(array, i)));
786                }
787                return copy;
788            }
789            return null;
790        }
791    
792        /**
793         * Creates and returns a deep copy of a given array.
794         * 
795         * @param array
796         *     The array to copy or {@code null}.
797         * @return
798         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
799         */
800        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
801        private static boolean[] copyOf(final boolean[] array) {
802            // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
803            if (array!= null) {
804                final boolean[] copy = ((boolean[]) Array.newInstance(array.getClass().getComponentType(), array.length));
805                System.arraycopy(array, 0, copy, 0, array.length);
806                return copy;
807            }
808            return null;
809        }
810    
811        /**
812         * Creates and returns a deep copy of a given array.
813         * 
814         * @param array
815         *     The array to copy or {@code null}.
816         * @return
817         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
818         */
819        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
820        private static byte[] copyOf(final byte[] array) {
821            // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
822            if (array!= null) {
823                final byte[] copy = ((byte[]) Array.newInstance(array.getClass().getComponentType(), array.length));
824                System.arraycopy(array, 0, copy, 0, array.length);
825                return copy;
826            }
827            return null;
828        }
829    
830        /**
831         * Creates and returns a deep copy of a given array.
832         * 
833         * @param array
834         *     The array to copy or {@code null}.
835         * @return
836         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
837         */
838        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
839        private static char[] copyOf(final char[] array) {
840            // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
841            if (array!= null) {
842                final char[] copy = ((char[]) Array.newInstance(array.getClass().getComponentType(), array.length));
843                System.arraycopy(array, 0, copy, 0, array.length);
844                return copy;
845            }
846            return null;
847        }
848    
849        /**
850         * Creates and returns a deep copy of a given array.
851         * 
852         * @param array
853         *     The array to copy or {@code null}.
854         * @return
855         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
856         */
857        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
858        private static double[] copyOf(final double[] array) {
859            // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
860            if (array!= null) {
861                final double[] copy = ((double[]) Array.newInstance(array.getClass().getComponentType(), array.length));
862                System.arraycopy(array, 0, copy, 0, array.length);
863                return copy;
864            }
865            return null;
866        }
867    
868        /**
869         * Creates and returns a deep copy of a given array.
870         * 
871         * @param array
872         *     The array to copy or {@code null}.
873         * @return
874         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
875         */
876        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
877        private static float[] copyOf(final float[] array) {
878            // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
879            if (array!= null) {
880                final float[] copy = ((float[]) Array.newInstance(array.getClass().getComponentType(), array.length));
881                System.arraycopy(array, 0, copy, 0, array.length);
882                return copy;
883            }
884            return null;
885        }
886    
887        /**
888         * Creates and returns a deep copy of a given array.
889         * 
890         * @param array
891         *     The array to copy or {@code null}.
892         * @return
893         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
894         */
895        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
896        private static int[] copyOf(final int[] array) {
897            // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
898            if (array!= null) {
899                final int[] copy = ((int[]) Array.newInstance(array.getClass().getComponentType(), array.length));
900                System.arraycopy(array, 0, copy, 0, array.length);
901                return copy;
902            }
903            return null;
904        }
905    
906        /**
907         * Creates and returns a deep copy of a given array.
908         * 
909         * @param array
910         *     The array to copy or {@code null}.
911         * @return
912         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
913         */
914        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
915        private static long[] copyOf(final long[] array) {
916            // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
917            if (array!= null) {
918                final long[] copy = ((long[]) Array.newInstance(array.getClass().getComponentType(), array.length));
919                System.arraycopy(array, 0, copy, 0, array.length);
920                return copy;
921            }
922            return null;
923        }
924    
925        /**
926         * Creates and returns a deep copy of a given array.
927         * 
928         * @param array
929         *     The array to copy or {@code null}.
930         * @return
931         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
932         */
933        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
934        private static short[] copyOf(final short[] array) {
935            // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
936            if (array!= null) {
937                final short[] copy = ((short[]) Array.newInstance(array.getClass().getComponentType(), array.length));
938                System.arraycopy(array, 0, copy, 0, array.length);
939                return copy;
940            }
941            return null;
942        }
943    
944        /**
945         * Creates and returns a deep copy of a given {@code JAXBElement} instance.
946         * 
947         * @param element
948         *     The instance to copy or {@code null}.
949         * @return
950         *     A deep copy of {@code element} or {@code null} if {@code element} is {@code null}.
951         */
952        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
953        private static JAXBElement copyOFJAXBElement(final JAXBElement element) {
954            // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
955            if (element!= null) {
956                final JAXBElement copy = new JAXBElement(element.getName(), element.getDeclaredType(), element.getScope(), element.getValue());
957                copy.setNil(element.isNil());
958                copy.setValue(copyOfObject(copy.getValue()));
959                return copy;
960            }
961            return null;
962        }
963    
964        /**
965         * Creates and returns a deep copy of a given {@code Serializable}.
966         * 
967         * @param serializable
968         *     The instance to copy or {@code null}.
969         * @return
970         *     A deep copy of {@code serializable} or {@code null} if {@code serializable} is {@code null}.
971         */
972        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
973        private static Serializable copyOfSerializable(final Serializable serializable) {
974            // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
975            if (serializable!= null) {
976                try {
977                    final ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream();
978                    final ObjectOutputStream out = new ObjectOutputStream(byteArrayOutput);
979                    out.writeObject(serializable);
980                    out.close();
981                    final ByteArrayInputStream byteArrayInput = new ByteArrayInputStream(byteArrayOutput.toByteArray());
982                    final ObjectInputStream in = new ObjectInputStream(byteArrayInput);
983                    final Serializable copy = ((Serializable) in.readObject());
984                    in.close();
985                    return copy;
986                } catch (SecurityException e) {
987                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
988                } catch (ClassNotFoundException e) {
989                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
990                } catch (InvalidClassException e) {
991                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
992                } catch (NotSerializableException e) {
993                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
994                } catch (StreamCorruptedException e) {
995                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
996                } catch (OptionalDataException e) {
997                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
998                } catch (IOException e) {
999                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
1000                }
1001            }
1002            return null;
1003        }
1004    
1005        /**
1006         * Creates and returns a deep copy of this object.
1007         * 
1008         * 
1009         * @return
1010         *     A deep copy of this object.
1011         */
1012        @Override
1013        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-11-18T06:28:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
1014        public Implementation clone() {
1015            // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
1016            return new Implementation(this);
1017        }
1018        
1019        /**
1020         * Gets the location URI used for locating instances of this implementation.
1021         *
1022         * @return The location URI used for locating instances of this implementation or {@code null}, if instances of this
1023         * implementation do not need to be located.
1024         *
1025         * @see #getLocation()
1026         */
1027        public java.net.URI getLocationUri()
1028        {
1029            try
1030            {
1031                java.net.URI javaLocation = null;
1032    
1033                if ( this.getLocation() != null )
1034                {
1035                    javaLocation = new java.net.URI( this.getLocation() );
1036                }
1037    
1038                return javaLocation;
1039            }
1040            catch ( java.net.URISyntaxException e )
1041            {
1042                throw new AssertionError( e );
1043            }
1044        }
1045    
1046          
1047    }