001    //
002    // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-2 
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: 2012.03.28 at 01:26:51 AM CEST 
006    //
007    
008    
009    package org.jomc.model;
010    
011    import java.io.ByteArrayInputStream;
012    import java.io.ByteArrayOutputStream;
013    import java.io.File;
014    import java.io.IOException;
015    import java.io.InvalidClassException;
016    import java.io.NotSerializableException;
017    import java.io.ObjectInputStream;
018    import java.io.ObjectOutputStream;
019    import java.io.OptionalDataException;
020    import java.io.Serializable;
021    import java.io.StreamCorruptedException;
022    import java.lang.reflect.Array;
023    import java.lang.reflect.InvocationTargetException;
024    import java.math.BigDecimal;
025    import java.math.BigInteger;
026    import java.net.MalformedURLException;
027    import java.net.URI;
028    import java.net.URISyntaxException;
029    import java.net.URL;
030    import java.util.ArrayList;
031    import java.util.Calendar;
032    import java.util.Currency;
033    import java.util.Date;
034    import java.util.Iterator;
035    import java.util.List;
036    import java.util.Locale;
037    import java.util.TimeZone;
038    import java.util.UUID;
039    import javax.activation.MimeType;
040    import javax.activation.MimeTypeParseException;
041    import javax.annotation.Generated;
042    import javax.xml.bind.JAXBElement;
043    import javax.xml.bind.annotation.XmlAccessType;
044    import javax.xml.bind.annotation.XmlAccessorType;
045    import javax.xml.bind.annotation.XmlAnyElement;
046    import javax.xml.bind.annotation.XmlAttribute;
047    import javax.xml.bind.annotation.XmlElement;
048    import javax.xml.bind.annotation.XmlType;
049    import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
050    import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
051    import javax.xml.datatype.Duration;
052    import javax.xml.datatype.XMLGregorianCalendar;
053    import javax.xml.namespace.QName;
054    import org.w3c.dom.Element;
055    
056    
057    /**
058     * 
059     * Model of a dependency.
060     * 
061     * The 'Dependency' type extends the 'SpecificationReference' type adding attributes 'implementationName', 'name',
062     * 'bound' and 'optional'. Attribute 'implementationName' holds an identifier selecting a single implementation from the
063     * set of implementations implementing the referenced specification. Attribute 'name' holds an identifier uniquely
064     * identifying the dependency in a set of dependencies. Attribute 'bound' flags the instances of the dependency bound
065     * to the declaring implementation. Attribute 'optional' flags a dependency optional. Dependencies, messages and properties
066     * set with a dependency override dependencies, messages and properties of the selected implementations.
067     *       
068     * 
069     * <p>Java class for Dependency complex type.
070     * 
071     * <p>The following schema fragment specifies the expected content contained within this class.
072     * 
073     * <pre>
074     * &lt;complexType name="Dependency">
075     *   &lt;complexContent>
076     *     &lt;extension base="{http://jomc.org/model}SpecificationReference">
077     *       &lt;sequence>
078     *         &lt;element ref="{http://jomc.org/model}dependencies" minOccurs="0"/>
079     *         &lt;element ref="{http://jomc.org/model}properties" minOccurs="0"/>
080     *         &lt;element ref="{http://jomc.org/model}messages" minOccurs="0"/>
081     *         &lt;any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
082     *       &lt;/sequence>
083     *       &lt;attribute name="implementationName" type="{http://jomc.org/model}Identifier" />
084     *       &lt;attribute name="name" use="required" type="{http://jomc.org/model}Identifier" />
085     *       &lt;attribute name="bound" type="{http://jomc.org/model}Flag" default="true" />
086     *       &lt;attribute name="optional" type="{http://jomc.org/model}Flag" default="false" />
087     *     &lt;/extension>
088     *   &lt;/complexContent>
089     * &lt;/complexType>
090     * </pre>
091     * 
092     * 
093     */
094    @XmlAccessorType(XmlAccessType.FIELD)
095    @XmlType(name = "Dependency", namespace = "http://jomc.org/model", propOrder = {
096        "dependencies",
097        "properties",
098        "messages",
099        "any"
100    })
101    @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
102    public class Dependency
103        extends SpecificationReference
104        implements Cloneable
105    {
106    
107        @XmlElement(namespace = "http://jomc.org/model")
108        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
109        protected Dependencies dependencies;
110        @XmlElement(namespace = "http://jomc.org/model")
111        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
112        protected Properties properties;
113        @XmlElement(namespace = "http://jomc.org/model")
114        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
115        protected Messages messages;
116        @XmlAnyElement(lax = true)
117        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
118        protected List<Object> any;
119        @XmlAttribute(name = "implementationName")
120        @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
121        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
122        protected String implementationName;
123        @XmlAttribute(name = "name", required = true)
124        @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
125        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
126        protected String name;
127        @XmlAttribute(name = "bound")
128        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
129        protected Boolean bound;
130        @XmlAttribute(name = "optional")
131        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
132        protected Boolean optional;
133    
134        /**
135         * Creates a new {@code Dependency} instance.
136         * 
137         */
138        public Dependency() {
139            // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
140            super();
141        }
142    
143        /**
144         * Creates a new {@code Dependency} instance by deeply copying a given {@code Dependency} instance.
145         * 
146         * 
147         * @param o
148         *     The instance to copy.
149         * @throws NullPointerException
150         *     if {@code o} is {@code null}.
151         */
152        public Dependency(final Dependency o) {
153            // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
154            super(o);
155            if (o == null) {
156                throw new NullPointerException("Cannot create a copy of 'Dependency' from 'null'.");
157            }
158            // CClassInfo: org.jomc.model.Dependencies
159            this.dependencies = ((o.dependencies == null)?null:((o.getDependencies() == null)?null:o.getDependencies().clone()));
160            // CClassInfo: org.jomc.model.Properties
161            this.properties = ((o.properties == null)?null:((o.getProperties() == null)?null:o.getProperties().clone()));
162            // CClassInfo: org.jomc.model.Messages
163            this.messages = ((o.messages == null)?null:((o.getMessages() == null)?null:o.getMessages().clone()));
164            // 'Any' collection.
165            if (o.any!= null) {
166                copyAny(o.getAny(), this.getAny());
167            }
168            // CBuiltinLeafInfo: java.lang.String
169            this.implementationName = ((o.implementationName == null)?null:o.getImplementationName());
170            // CBuiltinLeafInfo: java.lang.String
171            this.name = ((o.name == null)?null:o.getName());
172            // CBuiltinLeafInfo: java.lang.Boolean
173            this.bound = ((o.bound == null)?null:o.isBound());
174            // CBuiltinLeafInfo: java.lang.Boolean
175            this.optional = ((o.optional == null)?null:o.isOptional());
176        }
177    
178        /**
179         * Dependencies of this dependency or {@code null}.
180         * 
181         * @return
182         *     possible object is
183         *     {@link Dependencies }
184         *     
185         */
186        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
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 = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
200        public void setDependencies(Dependencies value) {
201            this.dependencies = value;
202        }
203    
204        /**
205         * Properties of this dependency or {@code null}.
206         * 
207         * @return
208         *     possible object is
209         *     {@link Properties }
210         *     
211         */
212        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
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 = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
226        public void setProperties(Properties value) {
227            this.properties = value;
228        }
229    
230        /**
231         * Messages of this dependency or {@code null}.
232         * 
233         * @return
234         *     possible object is
235         *     {@link Messages }
236         *     
237         */
238        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
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 = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
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 = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
280        public List<Object> getAny() {
281            if (any == null) {
282                any = new ArrayList<Object>();
283            }
284            return this.any;
285        }
286    
287        /**
288         * Name of the selected implementation of the specification of this dependency or {@code null}.
289         * 
290         * @return
291         *     possible object is
292         *     {@link String }
293         *     
294         */
295        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
296        public String getImplementationName() {
297            return implementationName;
298        }
299    
300        /**
301         * Sets the value of the implementationName property.
302         * 
303         * @param value
304         *     allowed object is
305         *     {@link String }
306         *     
307         */
308        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
309        public void setImplementationName(String value) {
310            this.implementationName = value;
311        }
312    
313        /**
314         * Name of this dependency.
315         * 
316         * @return
317         *     possible object is
318         *     {@link String }
319         *     
320         */
321        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
322        public String getName() {
323            return name;
324        }
325    
326        /**
327         * Sets the value of the name property.
328         * 
329         * @param value
330         *     allowed object is
331         *     {@link String }
332         *     
333         */
334        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
335        public void setName(String value) {
336            this.name = value;
337        }
338    
339        /**
340         * {@code true}, if instances of this dependency are bound to the declaring implementation.
341         * 
342         * @return
343         *     possible object is
344         *     {@link Boolean }
345         *     
346         */
347        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
348        public boolean isBound() {
349            if (bound == null) {
350                return true;
351            } else {
352                return bound;
353            }
354        }
355    
356        /**
357         * Sets the value of the bound property.
358         * 
359         * @param value
360         *     allowed object is
361         *     {@link Boolean }
362         *     
363         */
364        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
365        public void setBound(Boolean value) {
366            this.bound = value;
367        }
368    
369        /**
370         * {@code true}, if this dependency is optional.
371         * 
372         * @return
373         *     possible object is
374         *     {@link Boolean }
375         *     
376         */
377        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
378        public boolean isOptional() {
379            if (optional == null) {
380                return false;
381            } else {
382                return optional;
383            }
384        }
385    
386        /**
387         * Sets the value of the optional property.
388         * 
389         * @param value
390         *     allowed object is
391         *     {@link Boolean }
392         *     
393         */
394        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
395        public void setOptional(Boolean value) {
396            this.optional = value;
397        }
398    
399        /**
400         * Copies all values of property {@code Any} deeply.
401         * 
402         * @param source
403         *     The source to copy from.
404         * @param target
405         *     The target to copy {@code source} to.
406         * @throws NullPointerException
407         *     if {@code target} is {@code null}.
408         */
409        @SuppressWarnings("unchecked")
410        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
411        private static void copyAny(final List<Object> source, final List<Object> target) {
412            // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
413            if ((source!= null)&&(!source.isEmpty())) {
414                for (final Iterator<?> it = source.iterator(); it.hasNext(); ) {
415                    final Object next = it.next();
416                    if (next instanceof Element) {
417                        // CWildcardTypeInfo: org.w3c.dom.Element
418                        target.add(((Element)((Element) next).cloneNode(true)));
419                        continue;
420                    }
421                    if (next instanceof Object) {
422                        // CBuiltinLeafInfo: java.lang.Object
423                        target.add(copyOf(((Object) next)));
424                        continue;
425                    }
426                    // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
427                    throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Any' of class 'org.jomc.model.Dependency'."));
428                }
429            }
430        }
431    
432        /**
433         * Creates and returns a deep copy of a given object.
434         * 
435         * @param o
436         *     The instance to copy or {@code null}.
437         * @return
438         *     A deep copy of {@code o} or {@code null} if {@code o} is {@code null}.
439         */
440        @SuppressWarnings("unchecked")
441        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
442        private static Object copyOf(final Object o) {
443            // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
444            try {
445                if (o!= null) {
446                    if (o.getClass().isPrimitive()) {
447                        return o;
448                    }
449                    if (o.getClass().isArray()) {
450                        return copyOfArray(o);
451                    }
452                    // Immutable types.
453                    if (o instanceof Boolean) {
454                        return o;
455                    }
456                    if (o instanceof Byte) {
457                        return o;
458                    }
459                    if (o instanceof Character) {
460                        return o;
461                    }
462                    if (o instanceof Double) {
463                        return o;
464                    }
465                    if (o instanceof Enum) {
466                        return o;
467                    }
468                    if (o instanceof Float) {
469                        return o;
470                    }
471                    if (o instanceof Integer) {
472                        return o;
473                    }
474                    if (o instanceof Long) {
475                        return o;
476                    }
477                    if (o instanceof Short) {
478                        return o;
479                    }
480                    if (o instanceof String) {
481                        return o;
482                    }
483                    if (o instanceof BigDecimal) {
484                        return o;
485                    }
486                    if (o instanceof BigInteger) {
487                        return o;
488                    }
489                    if (o instanceof UUID) {
490                        return o;
491                    }
492                    if (o instanceof QName) {
493                        return o;
494                    }
495                    if (o instanceof Duration) {
496                        return o;
497                    }
498                    if (o instanceof Currency) {
499                        return o;
500                    }
501                    // String based types.
502                    if (o instanceof File) {
503                        return new File(o.toString());
504                    }
505                    if (o instanceof URI) {
506                        return new URI(o.toString());
507                    }
508                    if (o instanceof URL) {
509                        return new URL(o.toString());
510                    }
511                    if (o instanceof MimeType) {
512                        return new MimeType(o.toString());
513                    }
514                    // Cloneable types.
515                    if (o instanceof XMLGregorianCalendar) {
516                        return ((XMLGregorianCalendar) o).clone();
517                    }
518                    if (o instanceof Date) {
519                        return ((Date) o).clone();
520                    }
521                    if (o instanceof Calendar) {
522                        return ((Calendar) o).clone();
523                    }
524                    if (o instanceof TimeZone) {
525                        return ((TimeZone) o).clone();
526                    }
527                    if (o instanceof Locale) {
528                        return ((Locale) o).clone();
529                    }
530                    if (o instanceof Element) {
531                        return ((Element)((Element) o).cloneNode(true));
532                    }
533                    if (o instanceof JAXBElement) {
534                        return copyOf(((JAXBElement) o));
535                    }
536                    try {
537                        return o.getClass().getMethod("clone", ((Class[]) null)).invoke(o, ((Object[]) null));
538                    } catch (NoSuchMethodException e) {
539                        if (o instanceof Serializable) {
540                            return copyOf(((Serializable) o));
541                        }
542                        // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
543                        throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
544                    } catch (IllegalAccessException e) {
545                        // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
546                        throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
547                    } catch (InvocationTargetException e) {
548                        // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
549                        throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
550                    } catch (SecurityException e) {
551                        // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
552                        throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
553                    } catch (IllegalArgumentException e) {
554                        // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
555                        throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
556                    } catch (ExceptionInInitializerError e) {
557                        // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
558                        throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
559                    }
560                }
561                return null;
562            } catch (MalformedURLException e) {
563                throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
564            } catch (MimeTypeParseException e) {
565                throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
566            } catch (URISyntaxException e) {
567                throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
568            }
569        }
570    
571        /**
572         * Creates and returns a deep copy of a given array.
573         * 
574         * @param array
575         *     The array to copy or {@code null}.
576         * @return
577         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
578         */
579        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
580        private static Object copyOfArray(final Object array) {
581            // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
582            if (array!= null) {
583                if (array.getClass() == boolean[].class) {
584                    return copyOf(((boolean[]) array));
585                }
586                if (array.getClass() == byte[].class) {
587                    return copyOf(((byte[]) array));
588                }
589                if (array.getClass() == char[].class) {
590                    return copyOf(((char[]) array));
591                }
592                if (array.getClass() == double[].class) {
593                    return copyOf(((double[]) array));
594                }
595                if (array.getClass() == float[].class) {
596                    return copyOf(((float[]) array));
597                }
598                if (array.getClass() == int[].class) {
599                    return copyOf(((int[]) array));
600                }
601                if (array.getClass() == long[].class) {
602                    return copyOf(((long[]) array));
603                }
604                if (array.getClass() == short[].class) {
605                    return copyOf(((short[]) array));
606                }
607                final int len = Array.getLength(array);
608                final Object copy = Array.newInstance(array.getClass().getComponentType(), len);
609                for (int i = (len- 1); (i >= 0); i--) {
610                    Array.set(copy, i, copyOf(Array.get(array, i)));
611                }
612                return copy;
613            }
614            return null;
615        }
616    
617        /**
618         * Creates and returns a deep copy of a given array.
619         * 
620         * @param array
621         *     The array to copy or {@code null}.
622         * @return
623         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
624         */
625        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
626        private static boolean[] copyOf(final boolean[] array) {
627            // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
628            if (array!= null) {
629                final boolean[] copy = ((boolean[]) Array.newInstance(array.getClass().getComponentType(), array.length));
630                System.arraycopy(array, 0, copy, 0, array.length);
631                return copy;
632            }
633            return null;
634        }
635    
636        /**
637         * Creates and returns a deep copy of a given array.
638         * 
639         * @param array
640         *     The array to copy or {@code null}.
641         * @return
642         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
643         */
644        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
645        private static byte[] copyOf(final byte[] array) {
646            // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
647            if (array!= null) {
648                final byte[] copy = ((byte[]) Array.newInstance(array.getClass().getComponentType(), array.length));
649                System.arraycopy(array, 0, copy, 0, array.length);
650                return copy;
651            }
652            return null;
653        }
654    
655        /**
656         * Creates and returns a deep copy of a given array.
657         * 
658         * @param array
659         *     The array to copy or {@code null}.
660         * @return
661         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
662         */
663        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
664        private static char[] copyOf(final char[] array) {
665            // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
666            if (array!= null) {
667                final char[] copy = ((char[]) Array.newInstance(array.getClass().getComponentType(), array.length));
668                System.arraycopy(array, 0, copy, 0, array.length);
669                return copy;
670            }
671            return null;
672        }
673    
674        /**
675         * Creates and returns a deep copy of a given array.
676         * 
677         * @param array
678         *     The array to copy or {@code null}.
679         * @return
680         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
681         */
682        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
683        private static double[] copyOf(final double[] array) {
684            // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
685            if (array!= null) {
686                final double[] copy = ((double[]) Array.newInstance(array.getClass().getComponentType(), array.length));
687                System.arraycopy(array, 0, copy, 0, array.length);
688                return copy;
689            }
690            return null;
691        }
692    
693        /**
694         * Creates and returns a deep copy of a given array.
695         * 
696         * @param array
697         *     The array to copy or {@code null}.
698         * @return
699         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
700         */
701        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
702        private static float[] copyOf(final float[] array) {
703            // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
704            if (array!= null) {
705                final float[] copy = ((float[]) Array.newInstance(array.getClass().getComponentType(), array.length));
706                System.arraycopy(array, 0, copy, 0, array.length);
707                return copy;
708            }
709            return null;
710        }
711    
712        /**
713         * Creates and returns a deep copy of a given array.
714         * 
715         * @param array
716         *     The array to copy or {@code null}.
717         * @return
718         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
719         */
720        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
721        private static int[] copyOf(final int[] array) {
722            // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
723            if (array!= null) {
724                final int[] copy = ((int[]) Array.newInstance(array.getClass().getComponentType(), array.length));
725                System.arraycopy(array, 0, copy, 0, array.length);
726                return copy;
727            }
728            return null;
729        }
730    
731        /**
732         * Creates and returns a deep copy of a given array.
733         * 
734         * @param array
735         *     The array to copy or {@code null}.
736         * @return
737         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
738         */
739        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
740        private static long[] copyOf(final long[] array) {
741            // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
742            if (array!= null) {
743                final long[] copy = ((long[]) Array.newInstance(array.getClass().getComponentType(), array.length));
744                System.arraycopy(array, 0, copy, 0, array.length);
745                return copy;
746            }
747            return null;
748        }
749    
750        /**
751         * Creates and returns a deep copy of a given array.
752         * 
753         * @param array
754         *     The array to copy or {@code null}.
755         * @return
756         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
757         */
758        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
759        private static short[] copyOf(final short[] array) {
760            // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
761            if (array!= null) {
762                final short[] copy = ((short[]) Array.newInstance(array.getClass().getComponentType(), array.length));
763                System.arraycopy(array, 0, copy, 0, array.length);
764                return copy;
765            }
766            return null;
767        }
768    
769        /**
770         * Creates and returns a deep copy of a given {@code JAXBElement} instance.
771         * 
772         * @param element
773         *     The instance to copy or {@code null}.
774         * @return
775         *     A deep copy of {@code element} or {@code null} if {@code element} is {@code null}.
776         */
777        @SuppressWarnings("unchecked")
778        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
779        private static JAXBElement copyOf(final JAXBElement element) {
780            // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
781            if (element!= null) {
782                final JAXBElement copy = new JAXBElement(element.getName(), element.getDeclaredType(), element.getScope(), element.getValue());
783                copy.setNil(element.isNil());
784                copy.setValue(copyOf(copy.getValue()));
785                return copy;
786            }
787            return null;
788        }
789    
790        /**
791         * Creates and returns a deep copy of a given {@code Serializable}.
792         * 
793         * @param serializable
794         *     The instance to copy or {@code null}.
795         * @return
796         *     A deep copy of {@code serializable} or {@code null} if {@code serializable} is {@code null}.
797         */
798        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
799        private static Serializable copyOf(final Serializable serializable) {
800            // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
801            if (serializable!= null) {
802                try {
803                    final ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream();
804                    final ObjectOutputStream out = new ObjectOutputStream(byteArrayOutput);
805                    out.writeObject(serializable);
806                    out.close();
807                    final ByteArrayInputStream byteArrayInput = new ByteArrayInputStream(byteArrayOutput.toByteArray());
808                    final ObjectInputStream in = new ObjectInputStream(byteArrayInput);
809                    final Serializable copy = ((Serializable) in.readObject());
810                    in.close();
811                    return copy;
812                } catch (SecurityException e) {
813                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
814                } catch (ClassNotFoundException e) {
815                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
816                } catch (InvalidClassException e) {
817                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
818                } catch (NotSerializableException e) {
819                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
820                } catch (StreamCorruptedException e) {
821                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
822                } catch (OptionalDataException e) {
823                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
824                } catch (IOException e) {
825                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
826                }
827            }
828            return null;
829        }
830    
831        /**
832         * Creates and returns a deep copy of this object.
833         * 
834         * 
835         * @return
836         *     A deep copy of this object.
837         */
838        @Override
839        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-03-28T01:26:51+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
840        public Dependency clone() {
841            {
842                // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
843                final Dependency clone = ((Dependency) super.clone());
844                // CClassInfo: org.jomc.model.Dependencies
845                clone.dependencies = ((this.dependencies == null)?null:((this.getDependencies() == null)?null:this.getDependencies().clone()));
846                // CClassInfo: org.jomc.model.Properties
847                clone.properties = ((this.properties == null)?null:((this.getProperties() == null)?null:this.getProperties().clone()));
848                // CClassInfo: org.jomc.model.Messages
849                clone.messages = ((this.messages == null)?null:((this.getMessages() == null)?null:this.getMessages().clone()));
850                // 'Any' collection.
851                if (this.any!= null) {
852                    clone.any = null;
853                    copyAny(this.getAny(), clone.getAny());
854                }
855                // CBuiltinLeafInfo: java.lang.String
856                clone.implementationName = ((this.implementationName == null)?null:this.getImplementationName());
857                // CBuiltinLeafInfo: java.lang.String
858                clone.name = ((this.name == null)?null:this.getName());
859                // CBuiltinLeafInfo: java.lang.Boolean
860                clone.bound = ((this.bound == null)?null:this.isBound());
861                // CBuiltinLeafInfo: java.lang.Boolean
862                clone.optional = ((this.optional == null)?null:this.isOptional());
863                return clone;
864            }
865        }
866        
867        /**
868         * Gets a single {@code JAXBElement} matching a namespace URI and local part from the {@code any} property of the
869         * instance.
870         *
871         * @param namespaceURI The namespace URI of the {@code JAXBElement} to return.
872         * @param localPart The local part of the {@code JAXBElement} to return.
873         *
874         * @return The {@code JAXBElement} matching {@code namespaceURI} and {@code localPart} from the {@code any} property
875         * of the instance or {@code null}, if no such element is found.
876         *
877         * @throws NullPointerException if {@code namespaceURI} or {@code localPart} is {@code null}.
878         * @throws IllegalStateException if the {@code any} property contains more than one matching element.
879         *
880         * @see #getAnyElement(java.util.List, java.lang.String, java.lang.String)
881         *
882         * @deprecated As of JOMC 1.1, please use method {@link #getAnyElement(java.lang.String, java.lang.String, java.lang.Class)}.
883         * This method will be removed in version 2.0.
884         */
885        @Deprecated
886        public javax.xml.bind.JAXBElement getAnyElement( final String namespaceURI, final String localPart )
887        {
888            return this.getAnyElement( this.getAny(), namespaceURI, localPart );
889        }
890    
891        /**
892         * Gets a list containing all {@code JAXBElement}s matching a namespace URI and local part from the {@code any}
893         * property of the instance.
894         *
895         * @param namespaceURI The namespace URI of the {@code JAXBElement}s to return.
896         * @param localPart The local part of the {@code JAXBElement}s to return.
897         *
898         * @return An unmodifiable list of all {@code JAXBElement}s matching {@code namespaceURI} and {@code localPart} from
899         * the {@code any} property of the instance - an empty list if no such elements are found.
900         *
901         * @throws NullPointerException if {@code namespaceURI} or {@code localPart} is {@code null}.
902         *
903         * @see #getAnyElements(java.util.List, java.lang.String, java.lang.String)
904         *
905         * @deprecated As of JOMC 1.1, please use method {@link #getAnyElements(java.lang.String, java.lang.String, java.lang.Class)}.
906         * This method will be removed in version 2.0.
907         */
908        @Deprecated
909        public java.util.List<javax.xml.bind.JAXBElement> getAnyElements( final String namespaceURI,
910                                                                          final String localPart )
911        {
912            return this.getAnyElements( this.getAny(), namespaceURI, localPart );
913        }
914    
915        /**
916         * Gets a single {@code JAXBElement} matching a namespace URI and local part from the {@code any} property of the
917         * instance.
918         *
919         * @param namespaceURI The namespace URI of the {@code JAXBElement} to return.
920         * @param localPart The local part of the {@code JAXBElement} to return.
921         * @param type The class of the type the element is bound to.
922         * @param <T> The type the element is bound to.
923         *
924         * @return The {@code JAXBElement} matching {@code namespaceURI} and {@code localPart} from the {@code any} property
925         * of the instance or {@code null}, if no such element is found.
926         *
927         * @throws NullPointerException if {@code namespaceURI}, {@code localPart} or {@code type} is {@code null}.
928         * @throws IllegalStateException if the {@code any} property contains more than one matching element.
929         *
930         * @see #getAnyElement(java.util.List, java.lang.String, java.lang.String, java.lang.Class)
931         *
932         * @since 1.1
933         */
934        public <T> javax.xml.bind.JAXBElement<T> getAnyElement( final String namespaceURI, final String localPart,
935                                                                final Class<T> type )
936        {
937            return this.getAnyElement( this.getAny(), namespaceURI, localPart, type );
938        }
939    
940        /**
941         * Gets a list containing all {@code JAXBElement}s matching a namespace URI and local part from the {@code any}
942         * property of the instance.
943         *
944         * @param namespaceURI The namespace URI of the {@code JAXBElement}s to return.
945         * @param localPart The local part of the {@code JAXBElement}s to return.
946         * @param type The class of the type the elements are bound to.
947         * @param <T> The type the elements are bound to.
948         *
949         * @return An unmodifiable list of all {@code JAXBElement}s matching {@code namespaceURI} and {@code localPart} from
950         * the {@code any} property of the instance - an empty list if no such elements are found.
951         *
952         * @throws NullPointerException if {@code namespaceURI}, {@code localPart} or {@code type} is {@code null}.
953         *
954         * @see #getAnyElements(java.util.List, java.lang.String, java.lang.String, java.lang.Class)
955         *
956         * @since 1.1
957         */
958        public <T> java.util.List<javax.xml.bind.JAXBElement<T>> getAnyElements( final String namespaceURI,
959                                                                                 final String localPart,
960                                                                                 final Class<T> type )
961        {
962            return this.getAnyElements( this.getAny(), namespaceURI, localPart, type );
963        }
964    
965        /**
966         * Gets a single object matching a given class from the {@code any} property of the instance.
967         *
968         * @param clazz The class to return an instance of.
969         * @param <T> The type of the object to return.
970         *
971         * @return The instance of {@code clazz} from the {@code any} property of the instance or {@code null}, if no such
972         * instance is found.
973         *
974         * @throws NullPointerException if {@code clazz} is {@code null}.
975         * @throws IllegalStateException if the {@code any} property contains more than one matching object.
976         *
977         * @see #getAnyObject(java.util.List, java.lang.Class)
978         */
979        public <T> T getAnyObject( final Class<T> clazz )
980        {
981            return this.getAnyObject( this.getAny(), clazz );
982        }
983    
984        /**
985         * Gets a list containing all objects matching a given class from the {@code any} property of the instance.
986         *
987         * @param clazz The class to return all instances of.
988         * @param <T> The type of the objects to return.
989         *
990         * @return An unmodifiable list of all instances of {@code clazz} from the {@code any} property of the instance -
991         * an empty list if no such objects are found.
992         *
993         * @throws NullPointerException if {@code clazz} is {@code null}.
994         *
995         * @see #getAnyObjects(java.util.List, java.lang.Class)
996         */
997        public <T> java.util.List<T> getAnyObjects( final Class<T> clazz )
998        {
999            return this.getAnyObjects( this.getAny(), clazz );
1000        }
1001          
1002    }