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.02 at 06:07:50 PM 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.XmlSeeAlso;
041    import javax.xml.bind.annotation.XmlType;
042    import javax.xml.datatype.Duration;
043    import javax.xml.datatype.XMLGregorianCalendar;
044    import javax.xml.namespace.QName;
045    import org.w3c.dom.Element;
046    
047    
048    /**
049     * Model of a person.
050     * <p>A person consists of the properties {@code name} and {@code mail}. Property
051     * {@code name} holds the name of the person. Property {@code mail} holds the mail
052     * address of the person.</p>
053     * 
054     * 
055     * 
056     */
057    @XmlAccessorType(XmlAccessType.FIELD)
058    @XmlType(name = "Person", propOrder = {
059        "any"
060    })
061    @XmlSeeAlso({
062        Author.class
063    })
064    @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
065    public class Person
066        extends ModelObject
067        implements Cloneable
068    {
069    
070        @XmlAnyElement(lax = true)
071        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
072        protected List<Object> any;
073        @XmlAttribute(required = true)
074        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
075        protected String name;
076        @XmlAttribute
077        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
078        protected String mail;
079    
080        /**
081         * Creates a new {@code Person} instance.
082         * 
083         */
084        public Person() {
085             // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
086            super();
087        }
088    
089        /**
090         * Creates a new {@code Person} instance by deeply copying a given instance.
091         * 
092         * @param o
093         *     The instance to copy or {@code null}.
094         */
095        public Person(final Person o) {
096             // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
097            super(o);
098            if (o!= null) {
099                {
100                    // 'Any' collection.
101                    copyAny(o.getAny(), getAny());
102                    // CBuiltinLeafInfo: java.lang.String
103                    this.name = ((String) o.getName());
104                    // CBuiltinLeafInfo: java.lang.String
105                    this.mail = ((String) o.getMail());
106                }
107            }
108        }
109    
110        /**
111         * Elements from other namespaces.Gets the value of the any property.
112         * 
113         * <p>
114         * This accessor method returns a reference to the live list,
115         * not a snapshot. Therefore any modification you make to the
116         * returned list will be present inside the JAXB object.
117         * This is why there is not a <CODE>set</CODE> method for the any property.
118         * 
119         * <p>
120         * For example, to add a new item, do as follows:
121         * <pre>
122         *    getAny().add(newItem);
123         * </pre>
124         * 
125         * 
126         * <p>
127         * Objects of the following type(s) are allowed in the list
128         * {@link Element }
129         * {@link Object }
130         * 
131         * 
132         */
133        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
134        public List<Object> getAny() {
135            if (any == null) {
136                any = new ArrayList<Object>();
137            }
138            return this.any;
139        }
140    
141        /**
142         * Name of the person.
143         * 
144         * @return
145         *     possible object is
146         *     {@link String }
147         *     
148         */
149        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
150        public String getName() {
151            return name;
152        }
153    
154        /**
155         * Sets the value of the name property.
156         * 
157         * @param value
158         *     allowed object is
159         *     {@link String }
160         *     
161         */
162        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
163        public void setName(String value) {
164            this.name = value;
165        }
166    
167        /**
168         * Mail address of the person or {@code null}.
169         * 
170         * @return
171         *     possible object is
172         *     {@link String }
173         *     
174         */
175        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
176        public String getMail() {
177            return mail;
178        }
179    
180        /**
181         * Sets the value of the mail property.
182         * 
183         * @param value
184         *     allowed object is
185         *     {@link String }
186         *     
187         */
188        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
189        public void setMail(String value) {
190            this.mail = value;
191        }
192    
193        /**
194         * Copies all values of property {@code Any} deeply.
195         * 
196         * @param target
197         *     The target to copy {@code source} to.
198         * @param source
199         *     The source to copy from.
200         * @throws NullPointerException
201         *     if {@code source} or {@code target} is {@code null}.
202         */
203        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
204        private static void copyAny(final List<Object> source, final List<Object> target) {
205            // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
206            if (!source.isEmpty()) {
207                for (Iterator it = source.iterator(); it.hasNext(); ) {
208                    final Object next = it.next();
209                    if (next instanceof Element) {
210                        // CWildcardTypeInfo: org.w3c.dom.Element
211                        target.add(((Element)((Element) next).cloneNode(true)));
212                        continue;
213                    }
214                    if (next instanceof Object) {
215                        // CBuiltinLeafInfo: java.lang.Object
216                        target.add(copyOfObject(((Object) next)));
217                        continue;
218                    }
219                    // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
220                    throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Any' of class 'org.jomc.model.Person'."));
221                }
222            }
223        }
224    
225        /**
226         * Creates and returns a deep copy of a given object.
227         * 
228         * @param o
229         *     The instance to copy or {@code null}.
230         * @return
231         *     A deep copy of {@code o} or {@code null} if {@code o} is {@code null}.
232         */
233        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
234        private static Object copyOfObject(final Object o) {
235            // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
236            if (o!= null) {
237                if (o.getClass().isPrimitive()) {
238                    return o;
239                }
240                if (o.getClass().isArray()) {
241                    return copyOfArray(o);
242                }
243                if (o instanceof Boolean) {
244                    return o;
245                }
246                if (o instanceof Byte) {
247                    return o;
248                }
249                if (o instanceof Character) {
250                    return o;
251                }
252                if (o instanceof Double) {
253                    return o;
254                }
255                if (o instanceof Enum) {
256                    return o;
257                }
258                if (o instanceof Float) {
259                    return o;
260                }
261                if (o instanceof Integer) {
262                    return o;
263                }
264                if (o instanceof Long) {
265                    return o;
266                }
267                if (o instanceof Short) {
268                    return o;
269                }
270                if (o instanceof String) {
271                    return o;
272                }
273                if (o instanceof BigDecimal) {
274                    return o;
275                }
276                if (o instanceof BigInteger) {
277                    return o;
278                }
279                if (o instanceof UUID) {
280                    return o;
281                }
282                if (o instanceof QName) {
283                    return o;
284                }
285                if (o instanceof Duration) {
286                    return o;
287                }
288                if (o instanceof Currency) {
289                    return o;
290                }
291                if (o instanceof XMLGregorianCalendar) {
292                    return ((XMLGregorianCalendar) o).clone();
293                }
294                if (o instanceof Date) {
295                    return ((Date) o).clone();
296                }
297                if (o instanceof Calendar) {
298                    return ((Calendar) o).clone();
299                }
300                if (o instanceof TimeZone) {
301                    return ((TimeZone) o).clone();
302                }
303                if (o instanceof Locale) {
304                    return ((Locale) o).clone();
305                }
306                if (o instanceof Element) {
307                    return ((Element)((Element) o).cloneNode(true));
308                }
309                if (o instanceof JAXBElement) {
310                    return copyOFJAXBElement(((JAXBElement) o));
311                }
312                try {
313                    return o.getClass().getMethod("clone", ((Class[]) null)).invoke(o, ((Object[]) null));
314                } catch (NoSuchMethodException e) {
315                    if (o instanceof Serializable) {
316                        return copyOfSerializable(((Serializable) o));
317                    }
318                    // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
319                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
320                } catch (IllegalAccessException e) {
321                    // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
322                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
323                } catch (InvocationTargetException e) {
324                    // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
325                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
326                } catch (SecurityException e) {
327                    // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
328                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
329                } catch (IllegalArgumentException e) {
330                    // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
331                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
332                } catch (ExceptionInInitializerError e) {
333                    // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
334                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
335                }
336            }
337            return null;
338        }
339    
340        /**
341         * Creates and returns a deep copy of a given array.
342         * 
343         * @param array
344         *     The array to copy or {@code null}.
345         * @return
346         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
347         */
348        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
349        private static Object copyOfArray(final Object array) {
350            // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
351            if (array!= null) {
352                if (array.getClass() == boolean[].class) {
353                    return copyOf(((boolean[]) array));
354                }
355                if (array.getClass() == byte[].class) {
356                    return copyOf(((byte[]) array));
357                }
358                if (array.getClass() == char[].class) {
359                    return copyOf(((char[]) array));
360                }
361                if (array.getClass() == double[].class) {
362                    return copyOf(((double[]) array));
363                }
364                if (array.getClass() == float[].class) {
365                    return copyOf(((float[]) array));
366                }
367                if (array.getClass() == int[].class) {
368                    return copyOf(((int[]) array));
369                }
370                if (array.getClass() == long[].class) {
371                    return copyOf(((long[]) array));
372                }
373                if (array.getClass() == short[].class) {
374                    return copyOf(((short[]) array));
375                }
376                final int len = Array.getLength(array);
377                final Object copy = Array.newInstance(array.getClass().getComponentType(), len);
378                for (int i = (len- 1); (i >= 0); i--) {
379                    Array.set(copy, i, copyOfObject(Array.get(array, i)));
380                }
381                return copy;
382            }
383            return null;
384        }
385    
386        /**
387         * Creates and returns a deep copy of a given array.
388         * 
389         * @param array
390         *     The array to copy or {@code null}.
391         * @return
392         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
393         */
394        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
395        private static boolean[] copyOf(final boolean[] array) {
396            // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
397            if (array!= null) {
398                final boolean[] copy = ((boolean[]) Array.newInstance(array.getClass().getComponentType(), array.length));
399                System.arraycopy(array, 0, copy, 0, array.length);
400                return copy;
401            }
402            return null;
403        }
404    
405        /**
406         * Creates and returns a deep copy of a given array.
407         * 
408         * @param array
409         *     The array to copy or {@code null}.
410         * @return
411         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
412         */
413        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
414        private static byte[] copyOf(final byte[] array) {
415            // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
416            if (array!= null) {
417                final byte[] copy = ((byte[]) Array.newInstance(array.getClass().getComponentType(), array.length));
418                System.arraycopy(array, 0, copy, 0, array.length);
419                return copy;
420            }
421            return null;
422        }
423    
424        /**
425         * Creates and returns a deep copy of a given array.
426         * 
427         * @param array
428         *     The array to copy or {@code null}.
429         * @return
430         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
431         */
432        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
433        private static char[] copyOf(final char[] array) {
434            // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
435            if (array!= null) {
436                final char[] copy = ((char[]) Array.newInstance(array.getClass().getComponentType(), array.length));
437                System.arraycopy(array, 0, copy, 0, array.length);
438                return copy;
439            }
440            return null;
441        }
442    
443        /**
444         * Creates and returns a deep copy of a given array.
445         * 
446         * @param array
447         *     The array to copy or {@code null}.
448         * @return
449         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
450         */
451        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
452        private static double[] copyOf(final double[] array) {
453            // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
454            if (array!= null) {
455                final double[] copy = ((double[]) Array.newInstance(array.getClass().getComponentType(), array.length));
456                System.arraycopy(array, 0, copy, 0, array.length);
457                return copy;
458            }
459            return null;
460        }
461    
462        /**
463         * Creates and returns a deep copy of a given array.
464         * 
465         * @param array
466         *     The array to copy or {@code null}.
467         * @return
468         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
469         */
470        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
471        private static float[] copyOf(final float[] array) {
472            // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
473            if (array!= null) {
474                final float[] copy = ((float[]) Array.newInstance(array.getClass().getComponentType(), array.length));
475                System.arraycopy(array, 0, copy, 0, array.length);
476                return copy;
477            }
478            return null;
479        }
480    
481        /**
482         * Creates and returns a deep copy of a given array.
483         * 
484         * @param array
485         *     The array to copy or {@code null}.
486         * @return
487         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
488         */
489        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
490        private static int[] copyOf(final int[] array) {
491            // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
492            if (array!= null) {
493                final int[] copy = ((int[]) Array.newInstance(array.getClass().getComponentType(), array.length));
494                System.arraycopy(array, 0, copy, 0, array.length);
495                return copy;
496            }
497            return null;
498        }
499    
500        /**
501         * Creates and returns a deep copy of a given array.
502         * 
503         * @param array
504         *     The array to copy or {@code null}.
505         * @return
506         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
507         */
508        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
509        private static long[] copyOf(final long[] array) {
510            // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
511            if (array!= null) {
512                final long[] copy = ((long[]) Array.newInstance(array.getClass().getComponentType(), array.length));
513                System.arraycopy(array, 0, copy, 0, array.length);
514                return copy;
515            }
516            return null;
517        }
518    
519        /**
520         * Creates and returns a deep copy of a given array.
521         * 
522         * @param array
523         *     The array to copy or {@code null}.
524         * @return
525         *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
526         */
527        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
528        private static short[] copyOf(final short[] array) {
529            // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
530            if (array!= null) {
531                final short[] copy = ((short[]) Array.newInstance(array.getClass().getComponentType(), array.length));
532                System.arraycopy(array, 0, copy, 0, array.length);
533                return copy;
534            }
535            return null;
536        }
537    
538        /**
539         * Creates and returns a deep copy of a given {@code JAXBElement} instance.
540         * 
541         * @param element
542         *     The instance to copy or {@code null}.
543         * @return
544         *     A deep copy of {@code element} or {@code null} if {@code element} is {@code null}.
545         */
546        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
547        private static JAXBElement copyOFJAXBElement(final JAXBElement element) {
548            // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
549            if (element!= null) {
550                final JAXBElement copy = new JAXBElement(element.getName(), element.getDeclaredType(), element.getScope(), element.getValue());
551                copy.setNil(element.isNil());
552                copy.setValue(copyOfObject(copy.getValue()));
553                return copy;
554            }
555            return null;
556        }
557    
558        /**
559         * Creates and returns a deep copy of a given {@code Serializable}.
560         * 
561         * @param serializable
562         *     The instance to copy or {@code null}.
563         * @return
564         *     A deep copy of {@code serializable} or {@code null} if {@code serializable} is {@code null}.
565         */
566        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
567        private static Serializable copyOfSerializable(final Serializable serializable) {
568            // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
569            if (serializable!= null) {
570                try {
571                    final ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream();
572                    final ObjectOutputStream out = new ObjectOutputStream(byteArrayOutput);
573                    out.writeObject(serializable);
574                    out.close();
575                    final ByteArrayInputStream byteArrayInput = new ByteArrayInputStream(byteArrayOutput.toByteArray());
576                    final ObjectInputStream in = new ObjectInputStream(byteArrayInput);
577                    final Serializable copy = ((Serializable) in.readObject());
578                    in.close();
579                    return copy;
580                } catch (SecurityException e) {
581                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
582                } catch (ClassNotFoundException e) {
583                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
584                } catch (InvalidClassException e) {
585                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
586                } catch (NotSerializableException e) {
587                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
588                } catch (StreamCorruptedException e) {
589                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
590                } catch (OptionalDataException e) {
591                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
592                } catch (IOException e) {
593                    throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
594                }
595            }
596            return null;
597        }
598    
599        /**
600         * Creates and returns a deep copy of this object.
601         * 
602         * 
603         * @return
604         *     A deep copy of this object.
605         */
606        @Override
607        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-02T06:07:50+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
608        public Person clone() {
609             // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
610            return new Person(this);
611        }
612    
613    }