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