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