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