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.06.29 at 05:36:20 PM CEST |
6 | // |
7 | |
8 | |
9 | package org.jomc.sdk.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.HashMap; |
30 | import java.util.Iterator; |
31 | import java.util.List; |
32 | import java.util.Locale; |
33 | import java.util.Map; |
34 | import java.util.TimeZone; |
35 | import java.util.UUID; |
36 | import javax.annotation.Generated; |
37 | import javax.xml.bind.JAXBElement; |
38 | import javax.xml.bind.annotation.XmlAccessType; |
39 | import javax.xml.bind.annotation.XmlAccessorType; |
40 | import javax.xml.bind.annotation.XmlAnyAttribute; |
41 | import javax.xml.bind.annotation.XmlAnyElement; |
42 | import javax.xml.bind.annotation.XmlType; |
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 | * The 'ListType' type declares a sequence of items. |
51 | * |
52 | * <p>Java class for ListType complex type. |
53 | * |
54 | * <p>The following schema fragment specifies the expected content contained within this class. |
55 | * |
56 | * <pre> |
57 | * <complexType name="ListType"> |
58 | * <complexContent> |
59 | * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> |
60 | * <sequence> |
61 | * <element ref="{http://jomc.org/sdk/model}item" maxOccurs="unbounded" minOccurs="0"/> |
62 | * <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/> |
63 | * </sequence> |
64 | * <anyAttribute processContents='lax'/> |
65 | * </restriction> |
66 | * </complexContent> |
67 | * </complexType> |
68 | * </pre> |
69 | * |
70 | * |
71 | */ |
72 | @XmlAccessorType(XmlAccessType.FIELD) |
73 | @XmlType(name = "ListType", propOrder = { |
74 | "item", |
75 | "any" |
76 | }) |
77 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
78 | public class ListType implements Cloneable |
79 | { |
80 | |
81 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
82 | protected List<ItemType> item; |
83 | @XmlAnyElement(lax = true) |
84 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
85 | protected List<Object> any; |
86 | @XmlAnyAttribute |
87 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
88 | private Map<QName, String> otherAttributes = new HashMap<QName, String>(); |
89 | |
90 | /** |
91 | * Creates a new {@code ListType} instance. |
92 | * |
93 | */ |
94 | public ListType() { |
95 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
96 | super(); |
97 | } |
98 | |
99 | /** |
100 | * Creates a new {@code ListType} instance by deeply copying a given {@code ListType} instance. |
101 | * |
102 | * |
103 | * @param o |
104 | * The instance to copy. |
105 | * @throws NullPointerException |
106 | * if {@code o} is {@code null}. |
107 | */ |
108 | public ListType(final ListType o) { |
109 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
110 | super(); |
111 | if (o == null) { |
112 | throw new NullPointerException("Cannot create a copy of 'ListType' from 'null'."); |
113 | } |
114 | // 'Item' collection. |
115 | copyItem(o.getItem(), getItem()); |
116 | // 'Any' collection. |
117 | copyAny(o.getAny(), getAny()); |
118 | // Other attributes. |
119 | this.otherAttributes.putAll(o.otherAttributes); |
120 | } |
121 | |
122 | /** |
123 | * Gets the value of the item property. |
124 | * |
125 | * <p> |
126 | * This accessor method returns a reference to the live list, |
127 | * not a snapshot. Therefore any modification you make to the |
128 | * returned list will be present inside the JAXB object. |
129 | * This is why there is not a <CODE>set</CODE> method for the item property. |
130 | * |
131 | * <p> |
132 | * For example, to add a new item, do as follows: |
133 | * <pre> |
134 | * getItem().add(newItem); |
135 | * </pre> |
136 | * |
137 | * |
138 | * <p> |
139 | * Objects of the following type(s) are allowed in the list |
140 | * {@link ItemType } |
141 | * |
142 | * |
143 | */ |
144 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
145 | public List<ItemType> getItem() { |
146 | if (item == null) { |
147 | item = new ArrayList<ItemType>(); |
148 | } |
149 | return this.item; |
150 | } |
151 | |
152 | /** |
153 | * Gets the value of the any property. |
154 | * |
155 | * <p> |
156 | * This accessor method returns a reference to the live list, |
157 | * not a snapshot. Therefore any modification you make to the |
158 | * returned list will be present inside the JAXB object. |
159 | * This is why there is not a <CODE>set</CODE> method for the any property. |
160 | * |
161 | * <p> |
162 | * For example, to add a new item, do as follows: |
163 | * <pre> |
164 | * getAny().add(newItem); |
165 | * </pre> |
166 | * |
167 | * |
168 | * <p> |
169 | * Objects of the following type(s) are allowed in the list |
170 | * {@link Element } |
171 | * {@link Object } |
172 | * |
173 | * |
174 | */ |
175 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
176 | public List<Object> getAny() { |
177 | if (any == null) { |
178 | any = new ArrayList<Object>(); |
179 | } |
180 | return this.any; |
181 | } |
182 | |
183 | /** |
184 | * Gets a map that contains attributes that aren't bound to any typed property on this class. |
185 | * |
186 | * <p> |
187 | * the map is keyed by the name of the attribute and |
188 | * the value is the string value of the attribute. |
189 | * |
190 | * the map returned by this method is live, and you can add new attribute |
191 | * by updating the map directly. Because of this design, there's no setter. |
192 | * |
193 | * |
194 | * @return |
195 | * always non-null |
196 | */ |
197 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
198 | public Map<QName, String> getOtherAttributes() { |
199 | return otherAttributes; |
200 | } |
201 | |
202 | /** |
203 | * Copies all values of property {@code Item} deeply. |
204 | * |
205 | * @param target |
206 | * The target to copy {@code source} to. |
207 | * @param source |
208 | * The source to copy from. |
209 | * @throws NullPointerException |
210 | * if {@code source} or {@code target} is {@code null}. |
211 | */ |
212 | @SuppressWarnings("unchecked") |
213 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
214 | private static void copyItem(final List<ItemType> source, final List<ItemType> target) { |
215 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
216 | if (!source.isEmpty()) { |
217 | for (Iterator it = source.iterator(); it.hasNext(); ) { |
218 | final Object next = it.next(); |
219 | if (next instanceof ItemType) { |
220 | // CClassInfo: org.jomc.sdk.model.ItemType |
221 | target.add(((ItemType) next).clone()); |
222 | continue; |
223 | } |
224 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
225 | throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Item' of class 'org.jomc.sdk.model.ListType'.")); |
226 | } |
227 | } |
228 | } |
229 | |
230 | /** |
231 | * Copies all values of property {@code Any} deeply. |
232 | * |
233 | * @param target |
234 | * The target to copy {@code source} to. |
235 | * @param source |
236 | * The source to copy from. |
237 | * @throws NullPointerException |
238 | * if {@code source} or {@code target} is {@code null}. |
239 | */ |
240 | @SuppressWarnings("unchecked") |
241 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
242 | private static void copyAny(final List<Object> source, final List<Object> target) { |
243 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
244 | if (!source.isEmpty()) { |
245 | for (Iterator it = source.iterator(); it.hasNext(); ) { |
246 | final Object next = it.next(); |
247 | if (next instanceof Element) { |
248 | // CWildcardTypeInfo: org.w3c.dom.Element |
249 | target.add(((Element)((Element) next).cloneNode(true))); |
250 | continue; |
251 | } |
252 | if (next instanceof Object) { |
253 | // CBuiltinLeafInfo: java.lang.Object |
254 | target.add(copyOfObject(((Object) next))); |
255 | continue; |
256 | } |
257 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
258 | throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Any' of class 'org.jomc.sdk.model.ListType'.")); |
259 | } |
260 | } |
261 | } |
262 | |
263 | /** |
264 | * Creates and returns a deep copy of a given object. |
265 | * |
266 | * @param o |
267 | * The instance to copy or {@code null}. |
268 | * @return |
269 | * A deep copy of {@code o} or {@code null} if {@code o} is {@code null}. |
270 | */ |
271 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
272 | private static Object copyOfObject(final Object o) { |
273 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
274 | if (o!= null) { |
275 | if (o.getClass().isPrimitive()) { |
276 | return o; |
277 | } |
278 | if (o.getClass().isArray()) { |
279 | return copyOfArray(o); |
280 | } |
281 | if (o instanceof Boolean) { |
282 | return o; |
283 | } |
284 | if (o instanceof Byte) { |
285 | return o; |
286 | } |
287 | if (o instanceof Character) { |
288 | return o; |
289 | } |
290 | if (o instanceof Double) { |
291 | return o; |
292 | } |
293 | if (o instanceof Enum) { |
294 | return o; |
295 | } |
296 | if (o instanceof Float) { |
297 | return o; |
298 | } |
299 | if (o instanceof Integer) { |
300 | return o; |
301 | } |
302 | if (o instanceof Long) { |
303 | return o; |
304 | } |
305 | if (o instanceof Short) { |
306 | return o; |
307 | } |
308 | if (o instanceof String) { |
309 | return o; |
310 | } |
311 | if (o instanceof BigDecimal) { |
312 | return o; |
313 | } |
314 | if (o instanceof BigInteger) { |
315 | return o; |
316 | } |
317 | if (o instanceof UUID) { |
318 | return o; |
319 | } |
320 | if (o instanceof QName) { |
321 | return o; |
322 | } |
323 | if (o instanceof Duration) { |
324 | return o; |
325 | } |
326 | if (o instanceof Currency) { |
327 | return o; |
328 | } |
329 | if (o instanceof XMLGregorianCalendar) { |
330 | return ((XMLGregorianCalendar) o).clone(); |
331 | } |
332 | if (o instanceof Date) { |
333 | return ((Date) o).clone(); |
334 | } |
335 | if (o instanceof Calendar) { |
336 | return ((Calendar) o).clone(); |
337 | } |
338 | if (o instanceof TimeZone) { |
339 | return ((TimeZone) o).clone(); |
340 | } |
341 | if (o instanceof Locale) { |
342 | return ((Locale) o).clone(); |
343 | } |
344 | if (o instanceof Element) { |
345 | return ((Element)((Element) o).cloneNode(true)); |
346 | } |
347 | if (o instanceof JAXBElement) { |
348 | return copyOFJAXBElement(((JAXBElement) o)); |
349 | } |
350 | try { |
351 | return o.getClass().getMethod("clone", ((Class[]) null)).invoke(o, ((Object[]) null)); |
352 | } catch (NoSuchMethodException e) { |
353 | if (o instanceof Serializable) { |
354 | return copyOfSerializable(((Serializable) o)); |
355 | } |
356 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
357 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); |
358 | } catch (IllegalAccessException e) { |
359 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
360 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); |
361 | } catch (InvocationTargetException e) { |
362 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
363 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); |
364 | } catch (SecurityException e) { |
365 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
366 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); |
367 | } catch (IllegalArgumentException e) { |
368 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
369 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); |
370 | } catch (ExceptionInInitializerError e) { |
371 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
372 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); |
373 | } |
374 | } |
375 | return null; |
376 | } |
377 | |
378 | /** |
379 | * Creates and returns a deep copy of a given array. |
380 | * |
381 | * @param array |
382 | * The array to copy or {@code null}. |
383 | * @return |
384 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
385 | */ |
386 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
387 | private static Object copyOfArray(final Object array) { |
388 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
389 | if (array!= null) { |
390 | if (array.getClass() == boolean[].class) { |
391 | return copyOf(((boolean[]) array)); |
392 | } |
393 | if (array.getClass() == byte[].class) { |
394 | return copyOf(((byte[]) array)); |
395 | } |
396 | if (array.getClass() == char[].class) { |
397 | return copyOf(((char[]) array)); |
398 | } |
399 | if (array.getClass() == double[].class) { |
400 | return copyOf(((double[]) array)); |
401 | } |
402 | if (array.getClass() == float[].class) { |
403 | return copyOf(((float[]) array)); |
404 | } |
405 | if (array.getClass() == int[].class) { |
406 | return copyOf(((int[]) array)); |
407 | } |
408 | if (array.getClass() == long[].class) { |
409 | return copyOf(((long[]) array)); |
410 | } |
411 | if (array.getClass() == short[].class) { |
412 | return copyOf(((short[]) array)); |
413 | } |
414 | final int len = Array.getLength(array); |
415 | final Object copy = Array.newInstance(array.getClass().getComponentType(), len); |
416 | for (int i = (len- 1); (i >= 0); i--) { |
417 | Array.set(copy, i, copyOfObject(Array.get(array, i))); |
418 | } |
419 | return copy; |
420 | } |
421 | return null; |
422 | } |
423 | |
424 | /** |
425 | * Creates and returns a deep copy of a given array. |
426 | * |
427 | * @param array |
428 | * The array to copy or {@code null}. |
429 | * @return |
430 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
431 | */ |
432 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
433 | private static boolean[] copyOf(final boolean[] array) { |
434 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
435 | if (array!= null) { |
436 | final boolean[] copy = ((boolean[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
437 | System.arraycopy(array, 0, copy, 0, array.length); |
438 | return copy; |
439 | } |
440 | return null; |
441 | } |
442 | |
443 | /** |
444 | * Creates and returns a deep copy of a given array. |
445 | * |
446 | * @param array |
447 | * The array to copy or {@code null}. |
448 | * @return |
449 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
450 | */ |
451 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
452 | private static byte[] copyOf(final byte[] array) { |
453 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
454 | if (array!= null) { |
455 | final byte[] copy = ((byte[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
456 | System.arraycopy(array, 0, copy, 0, array.length); |
457 | return copy; |
458 | } |
459 | return null; |
460 | } |
461 | |
462 | /** |
463 | * Creates and returns a deep copy of a given array. |
464 | * |
465 | * @param array |
466 | * The array to copy or {@code null}. |
467 | * @return |
468 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
469 | */ |
470 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
471 | private static char[] copyOf(final char[] array) { |
472 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
473 | if (array!= null) { |
474 | final char[] copy = ((char[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
475 | System.arraycopy(array, 0, copy, 0, array.length); |
476 | return copy; |
477 | } |
478 | return null; |
479 | } |
480 | |
481 | /** |
482 | * Creates and returns a deep copy of a given array. |
483 | * |
484 | * @param array |
485 | * The array to copy or {@code null}. |
486 | * @return |
487 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
488 | */ |
489 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
490 | private static double[] copyOf(final double[] array) { |
491 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
492 | if (array!= null) { |
493 | final double[] copy = ((double[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
494 | System.arraycopy(array, 0, copy, 0, array.length); |
495 | return copy; |
496 | } |
497 | return null; |
498 | } |
499 | |
500 | /** |
501 | * Creates and returns a deep copy of a given array. |
502 | * |
503 | * @param array |
504 | * The array to copy or {@code null}. |
505 | * @return |
506 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
507 | */ |
508 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
509 | private static float[] copyOf(final float[] array) { |
510 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
511 | if (array!= null) { |
512 | final float[] copy = ((float[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
513 | System.arraycopy(array, 0, copy, 0, array.length); |
514 | return copy; |
515 | } |
516 | return null; |
517 | } |
518 | |
519 | /** |
520 | * Creates and returns a deep copy of a given array. |
521 | * |
522 | * @param array |
523 | * The array to copy or {@code null}. |
524 | * @return |
525 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
526 | */ |
527 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
528 | private static int[] copyOf(final int[] array) { |
529 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
530 | if (array!= null) { |
531 | final int[] copy = ((int[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
532 | System.arraycopy(array, 0, copy, 0, array.length); |
533 | return copy; |
534 | } |
535 | return null; |
536 | } |
537 | |
538 | /** |
539 | * Creates and returns a deep copy of a given array. |
540 | * |
541 | * @param array |
542 | * The array to copy or {@code null}. |
543 | * @return |
544 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
545 | */ |
546 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
547 | private static long[] copyOf(final long[] array) { |
548 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
549 | if (array!= null) { |
550 | final long[] copy = ((long[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
551 | System.arraycopy(array, 0, copy, 0, array.length); |
552 | return copy; |
553 | } |
554 | return null; |
555 | } |
556 | |
557 | /** |
558 | * Creates and returns a deep copy of a given array. |
559 | * |
560 | * @param array |
561 | * The array to copy or {@code null}. |
562 | * @return |
563 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
564 | */ |
565 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
566 | private static short[] copyOf(final short[] array) { |
567 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
568 | if (array!= null) { |
569 | final short[] copy = ((short[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
570 | System.arraycopy(array, 0, copy, 0, array.length); |
571 | return copy; |
572 | } |
573 | return null; |
574 | } |
575 | |
576 | /** |
577 | * Creates and returns a deep copy of a given {@code JAXBElement} instance. |
578 | * |
579 | * @param element |
580 | * The instance to copy or {@code null}. |
581 | * @return |
582 | * A deep copy of {@code element} or {@code null} if {@code element} is {@code null}. |
583 | */ |
584 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
585 | private static JAXBElement copyOFJAXBElement(final JAXBElement element) { |
586 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
587 | if (element!= null) { |
588 | final JAXBElement copy = new JAXBElement(element.getName(), element.getDeclaredType(), element.getScope(), element.getValue()); |
589 | copy.setNil(element.isNil()); |
590 | copy.setValue(copyOfObject(copy.getValue())); |
591 | return copy; |
592 | } |
593 | return null; |
594 | } |
595 | |
596 | /** |
597 | * Creates and returns a deep copy of a given {@code Serializable}. |
598 | * |
599 | * @param serializable |
600 | * The instance to copy or {@code null}. |
601 | * @return |
602 | * A deep copy of {@code serializable} or {@code null} if {@code serializable} is {@code null}. |
603 | */ |
604 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
605 | private static Serializable copyOfSerializable(final Serializable serializable) { |
606 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
607 | if (serializable!= null) { |
608 | try { |
609 | final ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream(); |
610 | final ObjectOutputStream out = new ObjectOutputStream(byteArrayOutput); |
611 | out.writeObject(serializable); |
612 | out.close(); |
613 | final ByteArrayInputStream byteArrayInput = new ByteArrayInputStream(byteArrayOutput.toByteArray()); |
614 | final ObjectInputStream in = new ObjectInputStream(byteArrayInput); |
615 | final Serializable copy = ((Serializable) in.readObject()); |
616 | in.close(); |
617 | return copy; |
618 | } catch (SecurityException e) { |
619 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
620 | } catch (ClassNotFoundException e) { |
621 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
622 | } catch (InvalidClassException e) { |
623 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
624 | } catch (NotSerializableException e) { |
625 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
626 | } catch (StreamCorruptedException e) { |
627 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
628 | } catch (OptionalDataException e) { |
629 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
630 | } catch (IOException e) { |
631 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
632 | } |
633 | } |
634 | return null; |
635 | } |
636 | |
637 | /** |
638 | * Creates and returns a deep copy of this object. |
639 | * |
640 | * |
641 | * @return |
642 | * A deep copy of this object. |
643 | */ |
644 | @Override |
645 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
646 | public ListType clone() { |
647 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
648 | return new ListType(this); |
649 | } |
650 | |
651 | /** |
652 | * Gets the Java value of this type. |
653 | * |
654 | * @param classLoader The class loader to use for getting the Java value; {@code null} to use the platform's |
655 | * bootstrap class loader. |
656 | * |
657 | * @return The Java value of this type. |
658 | * |
659 | * @throws org.jomc.model.PropertyException if getting the Java value fails. |
660 | */ |
661 | public java.util.List getJavaValue( final ClassLoader classLoader ) throws org.jomc.model.PropertyException |
662 | { |
663 | final java.util.List javaValue = new java.util.ArrayList( this.getItem().size() ); |
664 | |
665 | for ( ItemType i : this.getItem() ) |
666 | { |
667 | javaValue.add( ReflectionHelper.getJavaValue( classLoader, i ) ); |
668 | } |
669 | |
670 | return java.util.Collections.unmodifiableList( javaValue ); |
671 | } |
672 | |
673 | |
674 | } |