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