1 | // |
2 | // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 |
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: 2010.02.03 at 01:25:12 AM UTC |
6 | // |
7 | |
8 | |
9 | package org.jomc.model; |
10 | |
11 | import java.io.ByteArrayInputStream; |
12 | import java.io.ByteArrayOutputStream; |
13 | import java.io.IOException; |
14 | import java.io.InvalidClassException; |
15 | import java.io.NotSerializableException; |
16 | import java.io.ObjectInputStream; |
17 | import java.io.ObjectOutputStream; |
18 | import java.io.OptionalDataException; |
19 | import java.io.Serializable; |
20 | import java.io.StreamCorruptedException; |
21 | import java.lang.reflect.Array; |
22 | import java.lang.reflect.InvocationTargetException; |
23 | import java.math.BigDecimal; |
24 | import java.math.BigInteger; |
25 | import java.util.ArrayList; |
26 | import java.util.Calendar; |
27 | import java.util.Currency; |
28 | import java.util.Date; |
29 | import java.util.Iterator; |
30 | import java.util.List; |
31 | import java.util.Locale; |
32 | import java.util.TimeZone; |
33 | import java.util.UUID; |
34 | import javax.annotation.Generated; |
35 | import javax.xml.bind.JAXBElement; |
36 | import javax.xml.bind.annotation.XmlAccessType; |
37 | import javax.xml.bind.annotation.XmlAccessorType; |
38 | import javax.xml.bind.annotation.XmlAnyElement; |
39 | import javax.xml.bind.annotation.XmlAttribute; |
40 | import javax.xml.bind.annotation.XmlType; |
41 | import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; |
42 | import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; |
43 | import javax.xml.datatype.Duration; |
44 | import javax.xml.datatype.XMLGregorianCalendar; |
45 | import javax.xml.namespace.QName; |
46 | import org.w3c.dom.Element; |
47 | |
48 | |
49 | /** |
50 | * |
51 | * Model of a module. |
52 | * |
53 | * The 'Module' type defines attributes 'name', 'version' and 'vendor'. Attribute 'name' holds the name of the module |
54 | * uniquely identifying the module in a set of modules. Attribute 'vendor' holds information regarding the vendor of the |
55 | * module. Attribute 'version' holds the version of the module. |
56 | * |
57 | * A module defines implementations, messages, properties and specifications. |
58 | * |
59 | * |
60 | * <p>Java class for Module complex type. |
61 | * |
62 | * <p>The following schema fragment specifies the expected content contained within this class. |
63 | * |
64 | * <pre> |
65 | * <complexType name="Module"> |
66 | * <complexContent> |
67 | * <extension base="{http://jomc.org/model}ModelObject"> |
68 | * <sequence> |
69 | * <element ref="{http://jomc.org/model}specifications" minOccurs="0"/> |
70 | * <element ref="{http://jomc.org/model}implementations" minOccurs="0"/> |
71 | * <element ref="{http://jomc.org/model}properties" minOccurs="0"/> |
72 | * <element ref="{http://jomc.org/model}messages" minOccurs="0"/> |
73 | * <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/> |
74 | * </sequence> |
75 | * <attribute name="name" use="required" type="{http://jomc.org/model}Identifier" /> |
76 | * <attribute name="version" type="{http://jomc.org/model}Version" /> |
77 | * <attribute name="vendor" type="{http://jomc.org/model}String" /> |
78 | * </extension> |
79 | * </complexContent> |
80 | * </complexType> |
81 | * </pre> |
82 | * |
83 | * |
84 | */ |
85 | @XmlAccessorType(XmlAccessType.FIELD) |
86 | @XmlType(name = "Module", propOrder = { |
87 | "specifications", |
88 | "implementations", |
89 | "properties", |
90 | "messages", |
91 | "any" |
92 | }) |
93 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
94 | public class Module |
95 | extends ModelObject |
96 | implements Cloneable |
97 | { |
98 | |
99 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
100 | protected Specifications specifications; |
101 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
102 | protected Implementations implementations; |
103 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
104 | protected Properties properties; |
105 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
106 | protected Messages messages; |
107 | @XmlAnyElement(lax = true) |
108 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
109 | protected List<Object> any; |
110 | @XmlAttribute(required = true) |
111 | @XmlJavaTypeAdapter(CollapsedStringAdapter.class) |
112 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
113 | protected String name; |
114 | @XmlAttribute |
115 | @XmlJavaTypeAdapter(CollapsedStringAdapter.class) |
116 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
117 | protected String version; |
118 | @XmlAttribute |
119 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
120 | protected String vendor; |
121 | |
122 | /** |
123 | * Creates a new {@code Module} instance. |
124 | * |
125 | */ |
126 | public Module() { |
127 | // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 |
128 | super(); |
129 | } |
130 | |
131 | /** |
132 | * Creates a new {@code Module} instance by deeply copying a given {@code Module} instance. |
133 | * |
134 | * |
135 | * @param o |
136 | * The instance to copy. |
137 | * @throws NullPointerException |
138 | * if {@code o} is {@code null}. |
139 | */ |
140 | public Module(final Module o) { |
141 | // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 |
142 | super(o); |
143 | if (o == null) { |
144 | throw new NullPointerException("Cannot create a copy of 'Module' from 'null'."); |
145 | } |
146 | // CClassInfo: org.jomc.model.Specifications |
147 | this.specifications = ((o.getSpecifications() == null)?null:o.getSpecifications().clone()); |
148 | // CClassInfo: org.jomc.model.Implementations |
149 | this.implementations = ((o.getImplementations() == null)?null:o.getImplementations().clone()); |
150 | // CClassInfo: org.jomc.model.Properties |
151 | this.properties = ((o.getProperties() == null)?null:o.getProperties().clone()); |
152 | // CClassInfo: org.jomc.model.Messages |
153 | this.messages = ((o.getMessages() == null)?null:o.getMessages().clone()); |
154 | // 'Any' collection. |
155 | copyAny(o.getAny(), getAny()); |
156 | // CBuiltinLeafInfo: java.lang.String |
157 | this.name = o.getName(); |
158 | // CBuiltinLeafInfo: java.lang.String |
159 | this.version = o.getVersion(); |
160 | // CBuiltinLeafInfo: java.lang.String |
161 | this.vendor = o.getVendor(); |
162 | } |
163 | |
164 | /** |
165 | * Specifications of this module or {@code null}. |
166 | * |
167 | * @return |
168 | * possible object is |
169 | * {@link Specifications } |
170 | * |
171 | */ |
172 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
173 | public Specifications getSpecifications() { |
174 | return specifications; |
175 | } |
176 | |
177 | /** |
178 | * Sets the value of the specifications property. |
179 | * |
180 | * @param value |
181 | * allowed object is |
182 | * {@link Specifications } |
183 | * |
184 | */ |
185 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
186 | public void setSpecifications(Specifications value) { |
187 | this.specifications = value; |
188 | } |
189 | |
190 | /** |
191 | * Implementations of this module or {@code null}. |
192 | * |
193 | * @return |
194 | * possible object is |
195 | * {@link Implementations } |
196 | * |
197 | */ |
198 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
199 | public Implementations getImplementations() { |
200 | return implementations; |
201 | } |
202 | |
203 | /** |
204 | * Sets the value of the implementations property. |
205 | * |
206 | * @param value |
207 | * allowed object is |
208 | * {@link Implementations } |
209 | * |
210 | */ |
211 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
212 | public void setImplementations(Implementations value) { |
213 | this.implementations = value; |
214 | } |
215 | |
216 | /** |
217 | * Properties of this module or {@code null}. |
218 | * |
219 | * @return |
220 | * possible object is |
221 | * {@link Properties } |
222 | * |
223 | */ |
224 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
225 | public Properties getProperties() { |
226 | return properties; |
227 | } |
228 | |
229 | /** |
230 | * Sets the value of the properties property. |
231 | * |
232 | * @param value |
233 | * allowed object is |
234 | * {@link Properties } |
235 | * |
236 | */ |
237 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
238 | public void setProperties(Properties value) { |
239 | this.properties = value; |
240 | } |
241 | |
242 | /** |
243 | * Messages of this module or {@code null}. |
244 | * |
245 | * @return |
246 | * possible object is |
247 | * {@link Messages } |
248 | * |
249 | */ |
250 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
251 | public Messages getMessages() { |
252 | return messages; |
253 | } |
254 | |
255 | /** |
256 | * Sets the value of the messages property. |
257 | * |
258 | * @param value |
259 | * allowed object is |
260 | * {@link Messages } |
261 | * |
262 | */ |
263 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
264 | public void setMessages(Messages value) { |
265 | this.messages = value; |
266 | } |
267 | |
268 | /** |
269 | * Gets the value of the any property. |
270 | * |
271 | * <p> |
272 | * This accessor method returns a reference to the live list, |
273 | * not a snapshot. Therefore any modification you make to the |
274 | * returned list will be present inside the JAXB object. |
275 | * This is why there is not a <CODE>set</CODE> method for the any property. |
276 | * |
277 | * <p> |
278 | * For example, to add a new item, do as follows: |
279 | * <pre> |
280 | * getAny().add(newItem); |
281 | * </pre> |
282 | * |
283 | * |
284 | * <p> |
285 | * Objects of the following type(s) are allowed in the list |
286 | * {@link Element } |
287 | * {@link Object } |
288 | * |
289 | * |
290 | */ |
291 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
292 | public List<Object> getAny() { |
293 | if (any == null) { |
294 | any = new ArrayList<Object>(); |
295 | } |
296 | return this.any; |
297 | } |
298 | |
299 | /** |
300 | * Name of this module. |
301 | * |
302 | * @return |
303 | * possible object is |
304 | * {@link String } |
305 | * |
306 | */ |
307 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
308 | public String getName() { |
309 | return name; |
310 | } |
311 | |
312 | /** |
313 | * Sets the value of the name property. |
314 | * |
315 | * @param value |
316 | * allowed object is |
317 | * {@link String } |
318 | * |
319 | */ |
320 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
321 | public void setName(String value) { |
322 | this.name = value; |
323 | } |
324 | |
325 | /** |
326 | * Version of this module or {@code null}. |
327 | * |
328 | * @return |
329 | * possible object is |
330 | * {@link String } |
331 | * |
332 | */ |
333 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
334 | public String getVersion() { |
335 | return version; |
336 | } |
337 | |
338 | /** |
339 | * Sets the value of the version property. |
340 | * |
341 | * @param value |
342 | * allowed object is |
343 | * {@link String } |
344 | * |
345 | */ |
346 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
347 | public void setVersion(String value) { |
348 | this.version = value; |
349 | } |
350 | |
351 | /** |
352 | * Vendor of this module or {@code null}. |
353 | * |
354 | * @return |
355 | * possible object is |
356 | * {@link String } |
357 | * |
358 | */ |
359 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
360 | public String getVendor() { |
361 | return vendor; |
362 | } |
363 | |
364 | /** |
365 | * Sets the value of the vendor property. |
366 | * |
367 | * @param value |
368 | * allowed object is |
369 | * {@link String } |
370 | * |
371 | */ |
372 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
373 | public void setVendor(String value) { |
374 | this.vendor = value; |
375 | } |
376 | |
377 | /** |
378 | * Copies all values of property {@code Any} deeply. |
379 | * |
380 | * @param target |
381 | * The target to copy {@code source} to. |
382 | * @param source |
383 | * The source to copy from. |
384 | * @throws NullPointerException |
385 | * if {@code source} or {@code target} is {@code null}. |
386 | */ |
387 | @SuppressWarnings("unchecked") |
388 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
389 | private static void copyAny(final List<Object> source, final List<Object> target) { |
390 | // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 |
391 | if (!source.isEmpty()) { |
392 | for (Iterator it = source.iterator(); it.hasNext(); ) { |
393 | final Object next = it.next(); |
394 | if (next instanceof Element) { |
395 | // CWildcardTypeInfo: org.w3c.dom.Element |
396 | target.add(((Element)((Element) next).cloneNode(true))); |
397 | continue; |
398 | } |
399 | if (next instanceof Object) { |
400 | // CBuiltinLeafInfo: java.lang.Object |
401 | target.add(copyOfObject(((Object) next))); |
402 | continue; |
403 | } |
404 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
405 | throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Any' of class 'org.jomc.model.Module'.")); |
406 | } |
407 | } |
408 | } |
409 | |
410 | /** |
411 | * Creates and returns a deep copy of a given object. |
412 | * |
413 | * @param o |
414 | * The instance to copy or {@code null}. |
415 | * @return |
416 | * A deep copy of {@code o} or {@code null} if {@code o} is {@code null}. |
417 | */ |
418 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
419 | private static Object copyOfObject(final Object o) { |
420 | // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 |
421 | if (o!= null) { |
422 | if (o.getClass().isPrimitive()) { |
423 | return o; |
424 | } |
425 | if (o.getClass().isArray()) { |
426 | return copyOfArray(o); |
427 | } |
428 | if (o instanceof Boolean) { |
429 | return o; |
430 | } |
431 | if (o instanceof Byte) { |
432 | return o; |
433 | } |
434 | if (o instanceof Character) { |
435 | return o; |
436 | } |
437 | if (o instanceof Double) { |
438 | return o; |
439 | } |
440 | if (o instanceof Enum) { |
441 | return o; |
442 | } |
443 | if (o instanceof Float) { |
444 | return o; |
445 | } |
446 | if (o instanceof Integer) { |
447 | return o; |
448 | } |
449 | if (o instanceof Long) { |
450 | return o; |
451 | } |
452 | if (o instanceof Short) { |
453 | return o; |
454 | } |
455 | if (o instanceof String) { |
456 | return o; |
457 | } |
458 | if (o instanceof BigDecimal) { |
459 | return o; |
460 | } |
461 | if (o instanceof BigInteger) { |
462 | return o; |
463 | } |
464 | if (o instanceof UUID) { |
465 | return o; |
466 | } |
467 | if (o instanceof QName) { |
468 | return o; |
469 | } |
470 | if (o instanceof Duration) { |
471 | return o; |
472 | } |
473 | if (o instanceof Currency) { |
474 | return o; |
475 | } |
476 | if (o instanceof XMLGregorianCalendar) { |
477 | return ((XMLGregorianCalendar) o).clone(); |
478 | } |
479 | if (o instanceof Date) { |
480 | return ((Date) o).clone(); |
481 | } |
482 | if (o instanceof Calendar) { |
483 | return ((Calendar) o).clone(); |
484 | } |
485 | if (o instanceof TimeZone) { |
486 | return ((TimeZone) o).clone(); |
487 | } |
488 | if (o instanceof Locale) { |
489 | return ((Locale) o).clone(); |
490 | } |
491 | if (o instanceof Element) { |
492 | return ((Element)((Element) o).cloneNode(true)); |
493 | } |
494 | if (o instanceof JAXBElement) { |
495 | return copyOFJAXBElement(((JAXBElement) o)); |
496 | } |
497 | try { |
498 | return o.getClass().getMethod("clone", ((Class[]) null)).invoke(o, ((Object[]) null)); |
499 | } catch (NoSuchMethodException e) { |
500 | if (o instanceof Serializable) { |
501 | return copyOfSerializable(((Serializable) o)); |
502 | } |
503 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
504 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); |
505 | } catch (IllegalAccessException e) { |
506 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
507 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); |
508 | } catch (InvocationTargetException e) { |
509 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
510 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); |
511 | } catch (SecurityException e) { |
512 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
513 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); |
514 | } catch (IllegalArgumentException e) { |
515 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
516 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); |
517 | } catch (ExceptionInInitializerError e) { |
518 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
519 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); |
520 | } |
521 | } |
522 | return null; |
523 | } |
524 | |
525 | /** |
526 | * Creates and returns a deep copy of a given array. |
527 | * |
528 | * @param array |
529 | * The array to copy or {@code null}. |
530 | * @return |
531 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
532 | */ |
533 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
534 | private static Object copyOfArray(final Object array) { |
535 | // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 |
536 | if (array!= null) { |
537 | if (array.getClass() == boolean[].class) { |
538 | return copyOf(((boolean[]) array)); |
539 | } |
540 | if (array.getClass() == byte[].class) { |
541 | return copyOf(((byte[]) array)); |
542 | } |
543 | if (array.getClass() == char[].class) { |
544 | return copyOf(((char[]) array)); |
545 | } |
546 | if (array.getClass() == double[].class) { |
547 | return copyOf(((double[]) array)); |
548 | } |
549 | if (array.getClass() == float[].class) { |
550 | return copyOf(((float[]) array)); |
551 | } |
552 | if (array.getClass() == int[].class) { |
553 | return copyOf(((int[]) array)); |
554 | } |
555 | if (array.getClass() == long[].class) { |
556 | return copyOf(((long[]) array)); |
557 | } |
558 | if (array.getClass() == short[].class) { |
559 | return copyOf(((short[]) array)); |
560 | } |
561 | final int len = Array.getLength(array); |
562 | final Object copy = Array.newInstance(array.getClass().getComponentType(), len); |
563 | for (int i = (len- 1); (i >= 0); i--) { |
564 | Array.set(copy, i, copyOfObject(Array.get(array, i))); |
565 | } |
566 | return copy; |
567 | } |
568 | return null; |
569 | } |
570 | |
571 | /** |
572 | * Creates and returns a deep copy of a given array. |
573 | * |
574 | * @param array |
575 | * The array to copy or {@code null}. |
576 | * @return |
577 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
578 | */ |
579 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
580 | private static boolean[] copyOf(final boolean[] array) { |
581 | // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 |
582 | if (array!= null) { |
583 | final boolean[] copy = ((boolean[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
584 | System.arraycopy(array, 0, copy, 0, array.length); |
585 | return copy; |
586 | } |
587 | return null; |
588 | } |
589 | |
590 | /** |
591 | * Creates and returns a deep copy of a given array. |
592 | * |
593 | * @param array |
594 | * The array to copy or {@code null}. |
595 | * @return |
596 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
597 | */ |
598 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
599 | private static byte[] copyOf(final byte[] array) { |
600 | // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 |
601 | if (array!= null) { |
602 | final byte[] copy = ((byte[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
603 | System.arraycopy(array, 0, copy, 0, array.length); |
604 | return copy; |
605 | } |
606 | return null; |
607 | } |
608 | |
609 | /** |
610 | * Creates and returns a deep copy of a given array. |
611 | * |
612 | * @param array |
613 | * The array to copy or {@code null}. |
614 | * @return |
615 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
616 | */ |
617 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
618 | private static char[] copyOf(final char[] array) { |
619 | // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 |
620 | if (array!= null) { |
621 | final char[] copy = ((char[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
622 | System.arraycopy(array, 0, copy, 0, array.length); |
623 | return copy; |
624 | } |
625 | return null; |
626 | } |
627 | |
628 | /** |
629 | * Creates and returns a deep copy of a given array. |
630 | * |
631 | * @param array |
632 | * The array to copy or {@code null}. |
633 | * @return |
634 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
635 | */ |
636 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
637 | private static double[] copyOf(final double[] array) { |
638 | // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 |
639 | if (array!= null) { |
640 | final double[] copy = ((double[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
641 | System.arraycopy(array, 0, copy, 0, array.length); |
642 | return copy; |
643 | } |
644 | return null; |
645 | } |
646 | |
647 | /** |
648 | * Creates and returns a deep copy of a given array. |
649 | * |
650 | * @param array |
651 | * The array to copy or {@code null}. |
652 | * @return |
653 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
654 | */ |
655 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
656 | private static float[] copyOf(final float[] array) { |
657 | // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 |
658 | if (array!= null) { |
659 | final float[] copy = ((float[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
660 | System.arraycopy(array, 0, copy, 0, array.length); |
661 | return copy; |
662 | } |
663 | return null; |
664 | } |
665 | |
666 | /** |
667 | * Creates and returns a deep copy of a given array. |
668 | * |
669 | * @param array |
670 | * The array to copy or {@code null}. |
671 | * @return |
672 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
673 | */ |
674 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
675 | private static int[] copyOf(final int[] array) { |
676 | // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 |
677 | if (array!= null) { |
678 | final int[] copy = ((int[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
679 | System.arraycopy(array, 0, copy, 0, array.length); |
680 | return copy; |
681 | } |
682 | return null; |
683 | } |
684 | |
685 | /** |
686 | * Creates and returns a deep copy of a given array. |
687 | * |
688 | * @param array |
689 | * The array to copy or {@code null}. |
690 | * @return |
691 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
692 | */ |
693 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
694 | private static long[] copyOf(final long[] array) { |
695 | // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 |
696 | if (array!= null) { |
697 | final long[] copy = ((long[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
698 | System.arraycopy(array, 0, copy, 0, array.length); |
699 | return copy; |
700 | } |
701 | return null; |
702 | } |
703 | |
704 | /** |
705 | * Creates and returns a deep copy of a given array. |
706 | * |
707 | * @param array |
708 | * The array to copy or {@code null}. |
709 | * @return |
710 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
711 | */ |
712 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
713 | private static short[] copyOf(final short[] array) { |
714 | // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 |
715 | if (array!= null) { |
716 | final short[] copy = ((short[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
717 | System.arraycopy(array, 0, copy, 0, array.length); |
718 | return copy; |
719 | } |
720 | return null; |
721 | } |
722 | |
723 | /** |
724 | * Creates and returns a deep copy of a given {@code JAXBElement} instance. |
725 | * |
726 | * @param element |
727 | * The instance to copy or {@code null}. |
728 | * @return |
729 | * A deep copy of {@code element} or {@code null} if {@code element} is {@code null}. |
730 | */ |
731 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
732 | private static JAXBElement copyOFJAXBElement(final JAXBElement element) { |
733 | // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 |
734 | if (element!= null) { |
735 | final JAXBElement copy = new JAXBElement(element.getName(), element.getDeclaredType(), element.getScope(), element.getValue()); |
736 | copy.setNil(element.isNil()); |
737 | copy.setValue(copyOfObject(copy.getValue())); |
738 | return copy; |
739 | } |
740 | return null; |
741 | } |
742 | |
743 | /** |
744 | * Creates and returns a deep copy of a given {@code Serializable}. |
745 | * |
746 | * @param serializable |
747 | * The instance to copy or {@code null}. |
748 | * @return |
749 | * A deep copy of {@code serializable} or {@code null} if {@code serializable} is {@code null}. |
750 | */ |
751 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
752 | private static Serializable copyOfSerializable(final Serializable serializable) { |
753 | // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 |
754 | if (serializable!= null) { |
755 | try { |
756 | final ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream(); |
757 | final ObjectOutputStream out = new ObjectOutputStream(byteArrayOutput); |
758 | out.writeObject(serializable); |
759 | out.close(); |
760 | final ByteArrayInputStream byteArrayInput = new ByteArrayInputStream(byteArrayOutput.toByteArray()); |
761 | final ObjectInputStream in = new ObjectInputStream(byteArrayInput); |
762 | final Serializable copy = ((Serializable) in.readObject()); |
763 | in.close(); |
764 | return copy; |
765 | } catch (SecurityException e) { |
766 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
767 | } catch (ClassNotFoundException e) { |
768 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
769 | } catch (InvalidClassException e) { |
770 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
771 | } catch (NotSerializableException e) { |
772 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
773 | } catch (StreamCorruptedException e) { |
774 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
775 | } catch (OptionalDataException e) { |
776 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
777 | } catch (IOException e) { |
778 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
779 | } |
780 | } |
781 | return null; |
782 | } |
783 | |
784 | /** |
785 | * Creates and returns a deep copy of this object. |
786 | * |
787 | * |
788 | * @return |
789 | * A deep copy of this object. |
790 | */ |
791 | @Override |
792 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-02-03T01:25:12+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
793 | public Module clone() { |
794 | // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000 |
795 | return new Module(this); |
796 | } |
797 | |
798 | } |