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