View Javadoc

1   //
2   // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-2 
3   // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
4   // Any modifications to this file will be lost upon recompilation of the source schema. 
5   // Generated on: 2012.05.23 at 02:54:23 AM CEST 
6   //
7   
8   
9   package org.jomc.tools.model;
10  
11  import java.io.ByteArrayInputStream;
12  import java.io.ByteArrayOutputStream;
13  import java.io.File;
14  import java.io.IOException;
15  import java.io.InvalidClassException;
16  import java.io.NotSerializableException;
17  import java.io.ObjectInputStream;
18  import java.io.ObjectOutputStream;
19  import java.io.OptionalDataException;
20  import java.io.Serializable;
21  import java.io.StreamCorruptedException;
22  import java.lang.reflect.Array;
23  import java.lang.reflect.InvocationTargetException;
24  import java.math.BigDecimal;
25  import java.math.BigInteger;
26  import java.net.MalformedURLException;
27  import java.net.URI;
28  import java.net.URISyntaxException;
29  import java.net.URL;
30  import java.util.ArrayList;
31  import java.util.Calendar;
32  import java.util.Currency;
33  import java.util.Date;
34  import java.util.Iterator;
35  import java.util.List;
36  import java.util.Locale;
37  import java.util.TimeZone;
38  import java.util.UUID;
39  import javax.activation.MimeType;
40  import javax.activation.MimeTypeParseException;
41  import javax.annotation.Generated;
42  import javax.xml.bind.JAXBElement;
43  import javax.xml.bind.annotation.XmlAccessType;
44  import javax.xml.bind.annotation.XmlAccessorType;
45  import javax.xml.bind.annotation.XmlAnyElement;
46  import javax.xml.bind.annotation.XmlAttribute;
47  import javax.xml.bind.annotation.XmlElement;
48  import javax.xml.bind.annotation.XmlType;
49  import javax.xml.datatype.Duration;
50  import javax.xml.datatype.XMLGregorianCalendar;
51  import javax.xml.namespace.QName;
52  import org.jomc.model.Inheritable;
53  import org.w3c.dom.Element;
54  
55  
56  /**
57   * Model of a source code file.
58   * 
59   * <p>Java class for SourceFileType complex type.
60   * 
61   * <p>The following schema fragment specifies the expected content contained within this class.
62   * 
63   * <pre>
64   * &lt;complexType name="SourceFileType">
65   *   &lt;complexContent>
66   *     &lt;extension base="{http://jomc.org/tools/model}ToolsType">
67   *       &lt;sequence>
68   *         &lt;element ref="{http://jomc.org/tools/model}source-sections" minOccurs="0"/>
69   *         &lt;any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
70   *       &lt;/sequence>
71   *       &lt;attribute name="identifier" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
72   *       &lt;attribute name="location" type="{http://www.w3.org/2001/XMLSchema}string" />
73   *       &lt;attribute name="template" type="{http://www.w3.org/2001/XMLSchema}string" />
74   *       &lt;attribute name="head-comment" type="{http://www.w3.org/2001/XMLSchema}string" />
75   *       &lt;attribute name="tail-comment" type="{http://www.w3.org/2001/XMLSchema}string" />
76   *       &lt;attribute name="final" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
77   *       &lt;attribute name="override" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
78   *     &lt;/extension>
79   *   &lt;/complexContent>
80   * &lt;/complexType>
81   * </pre>
82   * 
83   * 
84   */
85  @XmlAccessorType(XmlAccessType.FIELD)
86  @XmlType(name = "SourceFileType", namespace = "http://jomc.org/tools/model", propOrder = {
87      "sourceSections",
88      "any"
89  })
90  @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
91  public class SourceFileType
92      extends ToolsType
93      implements Cloneable, Inheritable
94  {
95  
96      @XmlElement(name = "source-sections", namespace = "http://jomc.org/tools/model")
97      @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
98      protected SourceSectionsType sourceSections;
99      @XmlAnyElement(lax = true)
100     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
101     protected List<Object> any;
102     @XmlAttribute(name = "identifier", required = true)
103     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
104     protected String identifier;
105     @XmlAttribute(name = "location")
106     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
107     protected String location;
108     @XmlAttribute(name = "template")
109     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
110     protected String template;
111     @XmlAttribute(name = "head-comment")
112     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
113     protected String headComment;
114     @XmlAttribute(name = "tail-comment")
115     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
116     protected String tailComment;
117     @XmlAttribute(name = "final")
118     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
119     protected Boolean _final;
120     @XmlAttribute(name = "override")
121     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
122     protected Boolean override;
123 
124     /**
125      * Creates a new {@code SourceFileType} instance.
126      * 
127      */
128     public SourceFileType() {
129         // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
130         super();
131     }
132 
133     /**
134      * Creates a new {@code SourceFileType} instance by deeply copying a given {@code SourceFileType} instance.
135      * 
136      * 
137      * @param o
138      *     The instance to copy.
139      * @throws NullPointerException
140      *     if {@code o} is {@code null}.
141      */
142     public SourceFileType(final SourceFileType o) {
143         // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
144         super(o);
145         if (o == null) {
146             throw new NullPointerException("Cannot create a copy of 'SourceFileType' from 'null'.");
147         }
148         // CClassInfo: org.jomc.tools.model.SourceSectionsType
149         this.sourceSections = ((o.sourceSections == null)?null:((o.getSourceSections() == null)?null:o.getSourceSections().clone()));
150         // 'Any' collection.
151         if (o.any!= null) {
152             copyAny(o.getAny(), this.getAny());
153         }
154         // CBuiltinLeafInfo: java.lang.String
155         this.identifier = ((o.identifier == null)?null:o.getIdentifier());
156         // CBuiltinLeafInfo: java.lang.String
157         this.location = ((o.location == null)?null:o.getLocation());
158         // CBuiltinLeafInfo: java.lang.String
159         this.template = ((o.template == null)?null:o.getTemplate());
160         // CBuiltinLeafInfo: java.lang.String
161         this.headComment = ((o.headComment == null)?null:o.getHeadComment());
162         // CBuiltinLeafInfo: java.lang.String
163         this.tailComment = ((o.tailComment == null)?null:o.getTailComment());
164         // CBuiltinLeafInfo: java.lang.Boolean
165         this._final = ((o._final == null)?null:o.isFinal());
166         // CBuiltinLeafInfo: java.lang.Boolean
167         this.override = ((o.override == null)?null:o.isOverride());
168     }
169 
170     /**
171      * Sections of the source file.
172      * 
173      * @return
174      *     possible object is
175      *     {@link SourceSectionsType }
176      *     
177      */
178     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
179     public SourceSectionsType getSourceSections() {
180         return sourceSections;
181     }
182 
183     /**
184      * Sets the value of the sourceSections property.
185      * 
186      * @param value
187      *     allowed object is
188      *     {@link SourceSectionsType }
189      *     
190      */
191     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
192     public void setSourceSections(SourceSectionsType value) {
193         this.sourceSections = value;
194     }
195 
196     /**
197      * Gets the value of the any property.
198      * 
199      * <p>
200      * This accessor method returns a reference to the live list,
201      * not a snapshot. Therefore any modification you make to the
202      * returned list will be present inside the JAXB object.
203      * This is why there is not a <CODE>set</CODE> method for the any property.
204      * 
205      * <p>
206      * For example, to add a new item, do as follows:
207      * <pre>
208      *    getAny().add(newItem);
209      * </pre>
210      * 
211      * 
212      * <p>
213      * Objects of the following type(s) are allowed in the list
214      * {@link Element }
215      * {@link Object }
216      * 
217      * 
218      */
219     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
220     public List<Object> getAny() {
221         if (any == null) {
222             any = new ArrayList<Object>();
223         }
224         return this.any;
225     }
226 
227     /**
228      * Gets the value of the identifier property.
229      * 
230      * @return
231      *     possible object is
232      *     {@link String }
233      *     
234      */
235     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
236     public String getIdentifier() {
237         return identifier;
238     }
239 
240     /**
241      * Sets the value of the identifier property.
242      * 
243      * @param value
244      *     allowed object is
245      *     {@link String }
246      *     
247      */
248     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
249     public void setIdentifier(String value) {
250         this.identifier = value;
251     }
252 
253     /**
254      * Gets the value of the location property.
255      * 
256      * @return
257      *     possible object is
258      *     {@link String }
259      *     
260      */
261     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
262     public String getLocation() {
263         return location;
264     }
265 
266     /**
267      * Sets the value of the location property.
268      * 
269      * @param value
270      *     allowed object is
271      *     {@link String }
272      *     
273      */
274     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
275     public void setLocation(String value) {
276         this.location = value;
277     }
278 
279     /**
280      * Gets the value of the template property.
281      * 
282      * @return
283      *     possible object is
284      *     {@link String }
285      *     
286      */
287     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
288     public String getTemplate() {
289         return template;
290     }
291 
292     /**
293      * Sets the value of the template property.
294      * 
295      * @param value
296      *     allowed object is
297      *     {@link String }
298      *     
299      */
300     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
301     public void setTemplate(String value) {
302         this.template = value;
303     }
304 
305     /**
306      * Gets the value of the headComment property.
307      * 
308      * @return
309      *     possible object is
310      *     {@link String }
311      *     
312      */
313     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
314     public String getHeadComment() {
315         return headComment;
316     }
317 
318     /**
319      * Sets the value of the headComment property.
320      * 
321      * @param value
322      *     allowed object is
323      *     {@link String }
324      *     
325      */
326     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
327     public void setHeadComment(String value) {
328         this.headComment = value;
329     }
330 
331     /**
332      * Gets the value of the tailComment property.
333      * 
334      * @return
335      *     possible object is
336      *     {@link String }
337      *     
338      */
339     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
340     public String getTailComment() {
341         return tailComment;
342     }
343 
344     /**
345      * Sets the value of the tailComment property.
346      * 
347      * @param value
348      *     allowed object is
349      *     {@link String }
350      *     
351      */
352     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
353     public void setTailComment(String value) {
354         this.tailComment = value;
355     }
356 
357     /**
358      * Gets the value of the final property.
359      * 
360      * @return
361      *     possible object is
362      *     {@link Boolean }
363      *     
364      */
365     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
366     public boolean isFinal() {
367         if (_final == null) {
368             return false;
369         } else {
370             return _final;
371         }
372     }
373 
374     /**
375      * Sets the value of the final property.
376      * 
377      * @param value
378      *     allowed object is
379      *     {@link Boolean }
380      *     
381      */
382     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
383     public void setFinal(Boolean value) {
384         this._final = value;
385     }
386 
387     /**
388      * Gets the value of the override property.
389      * 
390      * @return
391      *     possible object is
392      *     {@link Boolean }
393      *     
394      */
395     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
396     public boolean isOverride() {
397         if (override == null) {
398             return false;
399         } else {
400             return override;
401         }
402     }
403 
404     /**
405      * Sets the value of the override property.
406      * 
407      * @param value
408      *     allowed object is
409      *     {@link Boolean }
410      *     
411      */
412     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
413     public void setOverride(Boolean value) {
414         this.override = value;
415     }
416 
417     /**
418      * Copies all values of property {@code Any} deeply.
419      * 
420      * @param source
421      *     The source to copy from.
422      * @param target
423      *     The target to copy {@code source} to.
424      * @throws NullPointerException
425      *     if {@code target} is {@code null}.
426      */
427     @SuppressWarnings("unchecked")
428     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
429     private static void copyAny(final List<Object> source, final List<Object> target) {
430         // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
431         if ((source!= null)&&(!source.isEmpty())) {
432             for (final Iterator<?> it = source.iterator(); it.hasNext(); ) {
433                 final Object next = it.next();
434                 if (next instanceof Element) {
435                     // CWildcardTypeInfo: org.w3c.dom.Element
436                     target.add(((Element)((Element) next).cloneNode(true)));
437                     continue;
438                 }
439                 if (next instanceof Object) {
440                     // CBuiltinLeafInfo: java.lang.Object
441                     target.add(copyOf(((Object) next)));
442                     continue;
443                 }
444                 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
445                 throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Any' of class 'org.jomc.tools.model.SourceFileType'."));
446             }
447         }
448     }
449 
450     /**
451      * Creates and returns a deep copy of a given object.
452      * 
453      * @param o
454      *     The instance to copy or {@code null}.
455      * @return
456      *     A deep copy of {@code o} or {@code null} if {@code o} is {@code null}.
457      */
458     @SuppressWarnings("unchecked")
459     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
460     private static Object copyOf(final Object o) {
461         // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
462         try {
463             if (o!= null) {
464                 if (o.getClass().isPrimitive()) {
465                     return o;
466                 }
467                 if (o.getClass().isArray()) {
468                     return copyOfArray(o);
469                 }
470                 // Immutable types.
471                 if (o instanceof Boolean) {
472                     return o;
473                 }
474                 if (o instanceof Byte) {
475                     return o;
476                 }
477                 if (o instanceof Character) {
478                     return o;
479                 }
480                 if (o instanceof Double) {
481                     return o;
482                 }
483                 if (o instanceof Enum) {
484                     return o;
485                 }
486                 if (o instanceof Float) {
487                     return o;
488                 }
489                 if (o instanceof Integer) {
490                     return o;
491                 }
492                 if (o instanceof Long) {
493                     return o;
494                 }
495                 if (o instanceof Short) {
496                     return o;
497                 }
498                 if (o instanceof String) {
499                     return o;
500                 }
501                 if (o instanceof BigDecimal) {
502                     return o;
503                 }
504                 if (o instanceof BigInteger) {
505                     return o;
506                 }
507                 if (o instanceof UUID) {
508                     return o;
509                 }
510                 if (o instanceof QName) {
511                     return o;
512                 }
513                 if (o instanceof Duration) {
514                     return o;
515                 }
516                 if (o instanceof Currency) {
517                     return o;
518                 }
519                 // String based types.
520                 if (o instanceof File) {
521                     return new File(o.toString());
522                 }
523                 if (o instanceof URI) {
524                     return new URI(o.toString());
525                 }
526                 if (o instanceof URL) {
527                     return new URL(o.toString());
528                 }
529                 if (o instanceof MimeType) {
530                     return new MimeType(o.toString());
531                 }
532                 // Cloneable types.
533                 if (o instanceof XMLGregorianCalendar) {
534                     return ((XMLGregorianCalendar) o).clone();
535                 }
536                 if (o instanceof Date) {
537                     return ((Date) o).clone();
538                 }
539                 if (o instanceof Calendar) {
540                     return ((Calendar) o).clone();
541                 }
542                 if (o instanceof TimeZone) {
543                     return ((TimeZone) o).clone();
544                 }
545                 if (o instanceof Locale) {
546                     return ((Locale) o).clone();
547                 }
548                 if (o instanceof Element) {
549                     return ((Element)((Element) o).cloneNode(true));
550                 }
551                 if (o instanceof JAXBElement) {
552                     return copyOf(((JAXBElement) o));
553                 }
554                 try {
555                     return o.getClass().getMethod("clone", ((Class[]) null)).invoke(o, ((Object[]) null));
556                 } catch (NoSuchMethodException e) {
557                     if (o instanceof Serializable) {
558                         return copyOf(((Serializable) o));
559                     }
560                     // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
561                     throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
562                 } catch (IllegalAccessException e) {
563                     // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
564                     throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
565                 } catch (InvocationTargetException e) {
566                     // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
567                     throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
568                 } catch (SecurityException e) {
569                     // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
570                     throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
571                 } catch (IllegalArgumentException e) {
572                     // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
573                     throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
574                 } catch (ExceptionInInitializerError e) {
575                     // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
576                     throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
577                 }
578             }
579             return null;
580         } catch (MalformedURLException e) {
581             throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
582         } catch (URISyntaxException e) {
583             throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
584         } catch (MimeTypeParseException e) {
585             throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
586         }
587     }
588 
589     /**
590      * Creates and returns a deep copy of a given array.
591      * 
592      * @param array
593      *     The array to copy or {@code null}.
594      * @return
595      *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
596      */
597     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
598     private static Object copyOfArray(final Object array) {
599         // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
600         if (array!= null) {
601             if (array.getClass() == boolean[].class) {
602                 return copyOf(((boolean[]) array));
603             }
604             if (array.getClass() == byte[].class) {
605                 return copyOf(((byte[]) array));
606             }
607             if (array.getClass() == char[].class) {
608                 return copyOf(((char[]) array));
609             }
610             if (array.getClass() == double[].class) {
611                 return copyOf(((double[]) array));
612             }
613             if (array.getClass() == float[].class) {
614                 return copyOf(((float[]) array));
615             }
616             if (array.getClass() == int[].class) {
617                 return copyOf(((int[]) array));
618             }
619             if (array.getClass() == long[].class) {
620                 return copyOf(((long[]) array));
621             }
622             if (array.getClass() == short[].class) {
623                 return copyOf(((short[]) array));
624             }
625             final int len = Array.getLength(array);
626             final Object copy = Array.newInstance(array.getClass().getComponentType(), len);
627             for (int i = (len- 1); (i >= 0); i--) {
628                 Array.set(copy, i, copyOf(Array.get(array, i)));
629             }
630             return copy;
631         }
632         return null;
633     }
634 
635     /**
636      * Creates and returns a deep copy of a given array.
637      * 
638      * @param array
639      *     The array to copy or {@code null}.
640      * @return
641      *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
642      */
643     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
644     private static boolean[] copyOf(final boolean[] array) {
645         // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
646         if (array!= null) {
647             final boolean[] copy = ((boolean[]) Array.newInstance(array.getClass().getComponentType(), array.length));
648             System.arraycopy(array, 0, copy, 0, array.length);
649             return copy;
650         }
651         return null;
652     }
653 
654     /**
655      * Creates and returns a deep copy of a given array.
656      * 
657      * @param array
658      *     The array to copy or {@code null}.
659      * @return
660      *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
661      */
662     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
663     private static byte[] copyOf(final byte[] array) {
664         // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
665         if (array!= null) {
666             final byte[] copy = ((byte[]) Array.newInstance(array.getClass().getComponentType(), array.length));
667             System.arraycopy(array, 0, copy, 0, array.length);
668             return copy;
669         }
670         return null;
671     }
672 
673     /**
674      * Creates and returns a deep copy of a given array.
675      * 
676      * @param array
677      *     The array to copy or {@code null}.
678      * @return
679      *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
680      */
681     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
682     private static char[] copyOf(final char[] array) {
683         // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
684         if (array!= null) {
685             final char[] copy = ((char[]) Array.newInstance(array.getClass().getComponentType(), array.length));
686             System.arraycopy(array, 0, copy, 0, array.length);
687             return copy;
688         }
689         return null;
690     }
691 
692     /**
693      * Creates and returns a deep copy of a given array.
694      * 
695      * @param array
696      *     The array to copy or {@code null}.
697      * @return
698      *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
699      */
700     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
701     private static double[] copyOf(final double[] array) {
702         // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
703         if (array!= null) {
704             final double[] copy = ((double[]) Array.newInstance(array.getClass().getComponentType(), array.length));
705             System.arraycopy(array, 0, copy, 0, array.length);
706             return copy;
707         }
708         return null;
709     }
710 
711     /**
712      * Creates and returns a deep copy of a given array.
713      * 
714      * @param array
715      *     The array to copy or {@code null}.
716      * @return
717      *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
718      */
719     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
720     private static float[] copyOf(final float[] array) {
721         // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
722         if (array!= null) {
723             final float[] copy = ((float[]) Array.newInstance(array.getClass().getComponentType(), array.length));
724             System.arraycopy(array, 0, copy, 0, array.length);
725             return copy;
726         }
727         return null;
728     }
729 
730     /**
731      * Creates and returns a deep copy of a given array.
732      * 
733      * @param array
734      *     The array to copy or {@code null}.
735      * @return
736      *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
737      */
738     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
739     private static int[] copyOf(final int[] array) {
740         // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
741         if (array!= null) {
742             final int[] copy = ((int[]) Array.newInstance(array.getClass().getComponentType(), array.length));
743             System.arraycopy(array, 0, copy, 0, array.length);
744             return copy;
745         }
746         return null;
747     }
748 
749     /**
750      * Creates and returns a deep copy of a given array.
751      * 
752      * @param array
753      *     The array to copy or {@code null}.
754      * @return
755      *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
756      */
757     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
758     private static long[] copyOf(final long[] array) {
759         // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
760         if (array!= null) {
761             final long[] copy = ((long[]) Array.newInstance(array.getClass().getComponentType(), array.length));
762             System.arraycopy(array, 0, copy, 0, array.length);
763             return copy;
764         }
765         return null;
766     }
767 
768     /**
769      * Creates and returns a deep copy of a given array.
770      * 
771      * @param array
772      *     The array to copy or {@code null}.
773      * @return
774      *     A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
775      */
776     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
777     private static short[] copyOf(final short[] array) {
778         // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
779         if (array!= null) {
780             final short[] copy = ((short[]) Array.newInstance(array.getClass().getComponentType(), array.length));
781             System.arraycopy(array, 0, copy, 0, array.length);
782             return copy;
783         }
784         return null;
785     }
786 
787     /**
788      * Creates and returns a deep copy of a given {@code JAXBElement} instance.
789      * 
790      * @param element
791      *     The instance to copy or {@code null}.
792      * @return
793      *     A deep copy of {@code element} or {@code null} if {@code element} is {@code null}.
794      */
795     @SuppressWarnings("unchecked")
796     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
797     private static JAXBElement copyOf(final JAXBElement element) {
798         // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
799         if (element!= null) {
800             final JAXBElement copy = new JAXBElement(element.getName(), element.getDeclaredType(), element.getScope(), element.getValue());
801             copy.setNil(element.isNil());
802             copy.setValue(copyOf(copy.getValue()));
803             return copy;
804         }
805         return null;
806     }
807 
808     /**
809      * Creates and returns a deep copy of a given {@code Serializable}.
810      * 
811      * @param serializable
812      *     The instance to copy or {@code null}.
813      * @return
814      *     A deep copy of {@code serializable} or {@code null} if {@code serializable} is {@code null}.
815      */
816     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
817     private static Serializable copyOf(final Serializable serializable) {
818         // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
819         if (serializable!= null) {
820             try {
821                 final ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream();
822                 final ObjectOutputStream out = new ObjectOutputStream(byteArrayOutput);
823                 out.writeObject(serializable);
824                 out.close();
825                 final ByteArrayInputStream byteArrayInput = new ByteArrayInputStream(byteArrayOutput.toByteArray());
826                 final ObjectInputStream in = new ObjectInputStream(byteArrayInput);
827                 final Serializable copy = ((Serializable) in.readObject());
828                 in.close();
829                 return copy;
830             } catch (SecurityException e) {
831                 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
832             } catch (ClassNotFoundException e) {
833                 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
834             } catch (InvalidClassException e) {
835                 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
836             } catch (NotSerializableException e) {
837                 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
838             } catch (StreamCorruptedException e) {
839                 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
840             } catch (OptionalDataException e) {
841                 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
842             } catch (IOException e) {
843                 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
844             }
845         }
846         return null;
847     }
848 
849     /**
850      * Creates and returns a deep copy of this object.
851      * 
852      * 
853      * @return
854      *     A deep copy of this object.
855      */
856     @Override
857     @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
858     public SourceFileType clone() {
859         {
860             // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
861             final SourceFileType clone = ((SourceFileType) super.clone());
862             // CClassInfo: org.jomc.tools.model.SourceSectionsType
863             clone.sourceSections = ((this.sourceSections == null)?null:((this.getSourceSections() == null)?null:this.getSourceSections().clone()));
864             // 'Any' collection.
865             if (this.any!= null) {
866                 clone.any = null;
867                 copyAny(this.getAny(), clone.getAny());
868             }
869             // CBuiltinLeafInfo: java.lang.String
870             clone.identifier = ((this.identifier == null)?null:this.getIdentifier());
871             // CBuiltinLeafInfo: java.lang.String
872             clone.location = ((this.location == null)?null:this.getLocation());
873             // CBuiltinLeafInfo: java.lang.String
874             clone.template = ((this.template == null)?null:this.getTemplate());
875             // CBuiltinLeafInfo: java.lang.String
876             clone.headComment = ((this.headComment == null)?null:this.getHeadComment());
877             // CBuiltinLeafInfo: java.lang.String
878             clone.tailComment = ((this.tailComment == null)?null:this.getTailComment());
879             // CBuiltinLeafInfo: java.lang.Boolean
880             clone._final = ((this._final == null)?null:this.isFinal());
881             // CBuiltinLeafInfo: java.lang.Boolean
882             clone.override = ((this.override == null)?null:this.isOverride());
883             return clone;
884         }
885     }
886     
887     /**
888      * Gets a single {@code JAXBElement} matching a namespace URI and local part from the {@code any} property of the
889      * instance.
890      *
891      * @param namespaceURI The namespace URI of the {@code JAXBElement} to return.
892      * @param localPart The local part of the {@code JAXBElement} to return.
893      * @param type The class of the type the element is bound to.
894      * @param <T> The type the element is bound to.
895      *
896      * @return The {@code JAXBElement} matching {@code namespaceURI} and {@code localPart} from the {@code any} property
897      * of the instance or {@code null}, if no such element is found.
898      *
899      * @throws NullPointerException if {@code namespaceURI}, {@code localPart} or {@code type} is {@code null}.
900      * @throws IllegalStateException if the {@code any} property contains more than one matching element.
901      *
902      * @see #getAnyElement(java.util.List, java.lang.String, java.lang.String, java.lang.Class)
903      */
904     public <T> javax.xml.bind.JAXBElement<T> getAnyElement( final String namespaceURI, final String localPart,
905                                                             final Class<T> type )
906     {
907         return this.getAnyElement( this.getAny(), namespaceURI, localPart, type );
908     }
909 
910     /**
911      * Gets a list containing all {@code JAXBElement}s matching a namespace URI and local part from the {@code any}
912      * property of the instance.
913      *
914      * @param namespaceURI The namespace URI of the {@code JAXBElement}s to return.
915      * @param localPart The local part of the {@code JAXBElement}s to return.
916      * @param type The class of the type the elements are bound to.
917      * @param <T> The type the elements are bound to.
918      *
919      * @return An unmodifiable list of all {@code JAXBElement}s matching {@code namespaceURI} and {@code localPart} from
920      * the {@code any} property of the instance - an empty list if no such elements are found.
921      *
922      * @throws NullPointerException if {@code namespaceURI}, {@code localPart} or {@code type} is {@code null}.
923      *
924      * @see #getAnyElements(java.util.List, java.lang.String, java.lang.String, java.lang.Class)
925      */
926     public <T> java.util.List<javax.xml.bind.JAXBElement<T>> getAnyElements( final String namespaceURI,
927                                                                              final String localPart,
928                                                                              final Class<T> type )
929     {
930         return this.getAnyElements( this.getAny(), namespaceURI, localPart, type );
931     }
932 
933     /**
934      * Gets a single object matching a given class from the {@code any} property of the instance.
935      *
936      * @param clazz The class to return an instance of.
937      * @param <T> The type of the object to return.
938      *
939      * @return The instance of {@code clazz} from the {@code any} property of the instance or {@code null}, if no such
940      * instance is found.
941      *
942      * @throws NullPointerException if {@code clazz} is {@code null}.
943      * @throws IllegalStateException if the {@code any} property contains more than one matching object.
944      *
945      * @see #getAnyObject(java.util.List, java.lang.Class)
946      */
947     public <T> T getAnyObject( final Class<T> clazz )
948     {
949         return this.getAnyObject( this.getAny(), clazz );
950     }
951 
952     /**
953      * Gets a list containing all objects matching a given class from the {@code any} property of the instance.
954      *
955      * @param clazz The class to return all instances of.
956      * @param <T> The type of the objects to return.
957      *
958      * @return An unmodifiable list of all instances of {@code clazz} from the {@code any} property of the instance -
959      * an empty list if no such objects are found.
960      *
961      * @throws NullPointerException if {@code clazz} is {@code null}.
962      *
963      * @see #getAnyObjects(java.util.List, java.lang.Class)
964      */
965     public <T> java.util.List<T> getAnyObjects( final Class<T> clazz )
966     {
967         return this.getAnyObjects( this.getAny(), clazz );
968     }
969       
970 }