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