001 //
002 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
003 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
004 // Any modifications to this file will be lost upon recompilation of the source schema.
005 // Generated on: 2009.12.07 at 03:06:36 AM UTC
006 //
007
008
009 package org.jomc.model;
010
011 import java.io.ByteArrayInputStream;
012 import java.io.ByteArrayOutputStream;
013 import java.io.IOException;
014 import java.io.InvalidClassException;
015 import java.io.NotSerializableException;
016 import java.io.ObjectInputStream;
017 import java.io.ObjectOutputStream;
018 import java.io.OptionalDataException;
019 import java.io.Serializable;
020 import java.io.StreamCorruptedException;
021 import java.lang.reflect.Array;
022 import java.lang.reflect.InvocationTargetException;
023 import java.math.BigDecimal;
024 import java.math.BigInteger;
025 import java.util.ArrayList;
026 import java.util.Calendar;
027 import java.util.Currency;
028 import java.util.Date;
029 import java.util.Iterator;
030 import java.util.List;
031 import java.util.Locale;
032 import java.util.TimeZone;
033 import java.util.UUID;
034 import javax.annotation.Generated;
035 import javax.xml.bind.JAXBElement;
036 import javax.xml.bind.annotation.XmlAccessType;
037 import javax.xml.bind.annotation.XmlAccessorType;
038 import javax.xml.bind.annotation.XmlAnyElement;
039 import javax.xml.bind.annotation.XmlAttribute;
040 import javax.xml.bind.annotation.XmlType;
041 import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
042 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
043 import javax.xml.datatype.Duration;
044 import javax.xml.datatype.XMLGregorianCalendar;
045 import javax.xml.namespace.QName;
046 import org.w3c.dom.Element;
047
048
049 /**
050 *
051 * Model of an instance.
052 *
053 * The 'Instance' type defines attributes 'identifier', 'name', 'class' and 'stateless'. Attribute 'identifier' holds an
054 * identifier uniquely identifying the instance in a set of instances. Attribute 'name' holds an identifier uniquely
055 * identifying the implementation of the specifications implemented by an instance. Attribute 'class' holds an identifier
056 * of the class of an instance. Attribute 'stateless' flags an instance stateless.
057 *
058 * An instance is build from implementations. An implementation declaring a location declares its instance located outside
059 * the scope of the model. An implementation not delcaring a class is only available during implementation inheritance
060 * processing. No instance is build from such implementations.
061 *
062 *
063 * <p>Java class for Instance complex type.
064 *
065 * <p>The following schema fragment specifies the expected content contained within this class.
066 *
067 * <pre>
068 * <complexType name="Instance">
069 * <complexContent>
070 * <extension base="{http://jomc.org/model}ModelObject">
071 * <sequence>
072 * <element ref="{http://jomc.org/model}specifications" minOccurs="0"/>
073 * <element ref="{http://jomc.org/model}dependencies" minOccurs="0"/>
074 * <element ref="{http://jomc.org/model}properties" minOccurs="0"/>
075 * <element ref="{http://jomc.org/model}messages" minOccurs="0"/>
076 * <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
077 * </sequence>
078 * <attribute name="identifier" use="required" type="{http://jomc.org/model}Identifier" />
079 * <attribute name="name" use="required" type="{http://jomc.org/model}Identifier" />
080 * <attribute name="class" use="required" type="{http://jomc.org/model}Identifier" />
081 * <attribute name="stateless" type="{http://jomc.org/model}Flag" default="false" />
082 * </extension>
083 * </complexContent>
084 * </complexType>
085 * </pre>
086 *
087 *
088 */
089 @XmlAccessorType(XmlAccessType.FIELD)
090 @XmlType(name = "Instance", propOrder = {
091 "specifications",
092 "dependencies",
093 "properties",
094 "messages",
095 "any"
096 })
097 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
098 public class Instance
099 extends ModelObject
100 implements Cloneable
101 {
102
103 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
104 protected Specifications specifications;
105 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
106 protected Dependencies dependencies;
107 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
108 protected Properties properties;
109 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
110 protected Messages messages;
111 @XmlAnyElement(lax = true)
112 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
113 protected List<Object> any;
114 @XmlAttribute(required = true)
115 @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
116 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
117 protected String identifier;
118 @XmlAttribute(required = true)
119 @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
120 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
121 protected String name;
122 @XmlAttribute(name = "class", required = true)
123 @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
124 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
125 protected String clazz;
126 @XmlAttribute
127 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
128 protected Boolean stateless;
129
130 /**
131 * Creates a new {@code Instance} instance.
132 *
133 */
134 public Instance() {
135 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
136 super();
137 }
138
139 /**
140 * Creates a new {@code Instance} instance by deeply copying a given {@code Instance} instance.
141 *
142 *
143 * @param o
144 * The instance to copy.
145 * @throws NullPointerException
146 * if {@code o} is {@code null}.
147 */
148 public Instance(final Instance o) {
149 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
150 super(o);
151 if (o == null) {
152 throw new NullPointerException("Cannot create a copy of 'Instance' from 'null'.");
153 }
154 // CClassInfo: org.jomc.model.Specifications
155 this.specifications = ((o.getSpecifications() == null)?null:o.getSpecifications().clone());
156 // CClassInfo: org.jomc.model.Dependencies
157 this.dependencies = ((o.getDependencies() == null)?null:o.getDependencies().clone());
158 // CClassInfo: org.jomc.model.Properties
159 this.properties = ((o.getProperties() == null)?null:o.getProperties().clone());
160 // CClassInfo: org.jomc.model.Messages
161 this.messages = ((o.getMessages() == null)?null:o.getMessages().clone());
162 // 'Any' collection.
163 copyAny(o.getAny(), getAny());
164 // CBuiltinLeafInfo: java.lang.String
165 this.identifier = o.getIdentifier();
166 // CBuiltinLeafInfo: java.lang.String
167 this.name = o.getName();
168 // CBuiltinLeafInfo: java.lang.String
169 this.clazz = o.getClazz();
170 // CBuiltinLeafInfo: java.lang.Boolean
171 this.stateless = o.isStateless();
172 }
173
174 /**
175 * Specifications implemented by this instance or {@code null}.
176 *
177 * @return
178 * possible object is
179 * {@link Specifications }
180 *
181 */
182 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
183 public Specifications getSpecifications() {
184 return specifications;
185 }
186
187 /**
188 * Sets the value of the specifications property.
189 *
190 * @param value
191 * allowed object is
192 * {@link Specifications }
193 *
194 */
195 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
196 public void setSpecifications(Specifications value) {
197 this.specifications = value;
198 }
199
200 /**
201 * Dependencies of this instance or {@code null}.
202 *
203 * @return
204 * possible object is
205 * {@link Dependencies }
206 *
207 */
208 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
209 public Dependencies getDependencies() {
210 return dependencies;
211 }
212
213 /**
214 * Sets the value of the dependencies property.
215 *
216 * @param value
217 * allowed object is
218 * {@link Dependencies }
219 *
220 */
221 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
222 public void setDependencies(Dependencies value) {
223 this.dependencies = value;
224 }
225
226 /**
227 * Properties of this instance or {@code null}.
228 *
229 * @return
230 * possible object is
231 * {@link Properties }
232 *
233 */
234 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
235 public Properties getProperties() {
236 return properties;
237 }
238
239 /**
240 * Sets the value of the properties property.
241 *
242 * @param value
243 * allowed object is
244 * {@link Properties }
245 *
246 */
247 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
248 public void setProperties(Properties value) {
249 this.properties = value;
250 }
251
252 /**
253 * Messages of this instance or {@code null}.
254 *
255 * @return
256 * possible object is
257 * {@link Messages }
258 *
259 */
260 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
261 public Messages getMessages() {
262 return messages;
263 }
264
265 /**
266 * Sets the value of the messages property.
267 *
268 * @param value
269 * allowed object is
270 * {@link Messages }
271 *
272 */
273 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
274 public void setMessages(Messages value) {
275 this.messages = value;
276 }
277
278 /**
279 * Gets the value of the any property.
280 *
281 * <p>
282 * This accessor method returns a reference to the live list,
283 * not a snapshot. Therefore any modification you make to the
284 * returned list will be present inside the JAXB object.
285 * This is why there is not a <CODE>set</CODE> method for the any property.
286 *
287 * <p>
288 * For example, to add a new item, do as follows:
289 * <pre>
290 * getAny().add(newItem);
291 * </pre>
292 *
293 *
294 * <p>
295 * Objects of the following type(s) are allowed in the list
296 * {@link Element }
297 * {@link Object }
298 *
299 *
300 */
301 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
302 public List<Object> getAny() {
303 if (any == null) {
304 any = new ArrayList<Object>();
305 }
306 return this.any;
307 }
308
309 /**
310 * The identifier of this instance.
311 *
312 * @return
313 * possible object is
314 * {@link String }
315 *
316 */
317 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
318 public String getIdentifier() {
319 return identifier;
320 }
321
322 /**
323 * Sets the value of the identifier property.
324 *
325 * @param value
326 * allowed object is
327 * {@link String }
328 *
329 */
330 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
331 public void setIdentifier(String value) {
332 this.identifier = value;
333 }
334
335 /**
336 * The name of the implementation of the specifications implemented by this instance.
337 *
338 * @return
339 * possible object is
340 * {@link String }
341 *
342 */
343 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
344 public String getName() {
345 return name;
346 }
347
348 /**
349 * Sets the value of the name property.
350 *
351 * @param value
352 * allowed object is
353 * {@link String }
354 *
355 */
356 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
357 public void setName(String value) {
358 this.name = value;
359 }
360
361 /**
362 * The identifier of the class of this instance.
363 *
364 * @return
365 * possible object is
366 * {@link String }
367 *
368 */
369 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
370 public String getClazz() {
371 return clazz;
372 }
373
374 /**
375 * Sets the value of the clazz property.
376 *
377 * @param value
378 * allowed object is
379 * {@link String }
380 *
381 */
382 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
383 public void setClazz(String value) {
384 this.clazz = value;
385 }
386
387 /**
388 * {@code true} if this instance does not retain state across operations.
389 *
390 * @return
391 * possible object is
392 * {@link Boolean }
393 *
394 */
395 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
396 public boolean isStateless() {
397 if (stateless == null) {
398 return false;
399 } else {
400 return stateless;
401 }
402 }
403
404 /**
405 * Sets the value of the stateless property.
406 *
407 * @param value
408 * allowed object is
409 * {@link Boolean }
410 *
411 */
412 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
413 public void setStateless(Boolean value) {
414 this.stateless = value;
415 }
416
417 /**
418 * Copies all values of property {@code Any} deeply.
419 *
420 * @param target
421 * The target to copy {@code source} to.
422 * @param source
423 * The source to copy from.
424 * @throws NullPointerException
425 * if {@code source} or {@code target} is {@code null}.
426 */
427 @SuppressWarnings("unchecked")
428 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
429 private static void copyAny(final List<Object> source, final List<Object> target) {
430 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
431 if (!source.isEmpty()) {
432 for (Iterator it = source.iterator(); it.hasNext(); ) {
433 final Object next = it.next();
434 if (next instanceof Element) {
435 // CWildcardTypeInfo: org.w3c.dom.Element
436 target.add(((Element)((Element) next).cloneNode(true)));
437 continue;
438 }
439 if (next instanceof Object) {
440 // CBuiltinLeafInfo: java.lang.Object
441 target.add(copyOfObject(((Object) next)));
442 continue;
443 }
444 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
445 throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Any' of class 'org.jomc.model.Instance'."));
446 }
447 }
448 }
449
450 /**
451 * Creates and returns a deep copy of a given object.
452 *
453 * @param o
454 * The instance to copy or {@code null}.
455 * @return
456 * A deep copy of {@code o} or {@code null} if {@code o} is {@code null}.
457 */
458 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
459 private static Object copyOfObject(final Object o) {
460 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
461 if (o!= null) {
462 if (o.getClass().isPrimitive()) {
463 return o;
464 }
465 if (o.getClass().isArray()) {
466 return copyOfArray(o);
467 }
468 if (o instanceof Boolean) {
469 return o;
470 }
471 if (o instanceof Byte) {
472 return o;
473 }
474 if (o instanceof Character) {
475 return o;
476 }
477 if (o instanceof Double) {
478 return o;
479 }
480 if (o instanceof Enum) {
481 return o;
482 }
483 if (o instanceof Float) {
484 return o;
485 }
486 if (o instanceof Integer) {
487 return o;
488 }
489 if (o instanceof Long) {
490 return o;
491 }
492 if (o instanceof Short) {
493 return o;
494 }
495 if (o instanceof String) {
496 return o;
497 }
498 if (o instanceof BigDecimal) {
499 return o;
500 }
501 if (o instanceof BigInteger) {
502 return o;
503 }
504 if (o instanceof UUID) {
505 return o;
506 }
507 if (o instanceof QName) {
508 return o;
509 }
510 if (o instanceof Duration) {
511 return o;
512 }
513 if (o instanceof Currency) {
514 return o;
515 }
516 if (o instanceof XMLGregorianCalendar) {
517 return ((XMLGregorianCalendar) o).clone();
518 }
519 if (o instanceof Date) {
520 return ((Date) o).clone();
521 }
522 if (o instanceof Calendar) {
523 return ((Calendar) o).clone();
524 }
525 if (o instanceof TimeZone) {
526 return ((TimeZone) o).clone();
527 }
528 if (o instanceof Locale) {
529 return ((Locale) o).clone();
530 }
531 if (o instanceof Element) {
532 return ((Element)((Element) o).cloneNode(true));
533 }
534 if (o instanceof JAXBElement) {
535 return copyOFJAXBElement(((JAXBElement) o));
536 }
537 try {
538 return o.getClass().getMethod("clone", ((Class[]) null)).invoke(o, ((Object[]) null));
539 } catch (NoSuchMethodException e) {
540 if (o instanceof Serializable) {
541 return copyOfSerializable(((Serializable) o));
542 }
543 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
544 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
545 } catch (IllegalAccessException e) {
546 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
547 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
548 } catch (InvocationTargetException e) {
549 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
550 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
551 } catch (SecurityException e) {
552 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
553 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
554 } catch (IllegalArgumentException e) {
555 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
556 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
557 } catch (ExceptionInInitializerError e) {
558 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
559 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
560 }
561 }
562 return null;
563 }
564
565 /**
566 * Creates and returns a deep copy of a given array.
567 *
568 * @param array
569 * The array to copy or {@code null}.
570 * @return
571 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
572 */
573 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
574 private static Object copyOfArray(final Object array) {
575 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
576 if (array!= null) {
577 if (array.getClass() == boolean[].class) {
578 return copyOf(((boolean[]) array));
579 }
580 if (array.getClass() == byte[].class) {
581 return copyOf(((byte[]) array));
582 }
583 if (array.getClass() == char[].class) {
584 return copyOf(((char[]) array));
585 }
586 if (array.getClass() == double[].class) {
587 return copyOf(((double[]) array));
588 }
589 if (array.getClass() == float[].class) {
590 return copyOf(((float[]) array));
591 }
592 if (array.getClass() == int[].class) {
593 return copyOf(((int[]) array));
594 }
595 if (array.getClass() == long[].class) {
596 return copyOf(((long[]) array));
597 }
598 if (array.getClass() == short[].class) {
599 return copyOf(((short[]) array));
600 }
601 final int len = Array.getLength(array);
602 final Object copy = Array.newInstance(array.getClass().getComponentType(), len);
603 for (int i = (len- 1); (i >= 0); i--) {
604 Array.set(copy, i, copyOfObject(Array.get(array, i)));
605 }
606 return copy;
607 }
608 return null;
609 }
610
611 /**
612 * Creates and returns a deep copy of a given array.
613 *
614 * @param array
615 * The array to copy or {@code null}.
616 * @return
617 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
618 */
619 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
620 private static boolean[] copyOf(final boolean[] array) {
621 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
622 if (array!= null) {
623 final boolean[] copy = ((boolean[]) Array.newInstance(array.getClass().getComponentType(), array.length));
624 System.arraycopy(array, 0, copy, 0, array.length);
625 return copy;
626 }
627 return null;
628 }
629
630 /**
631 * Creates and returns a deep copy of a given array.
632 *
633 * @param array
634 * The array to copy or {@code null}.
635 * @return
636 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
637 */
638 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
639 private static byte[] copyOf(final byte[] array) {
640 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
641 if (array!= null) {
642 final byte[] copy = ((byte[]) Array.newInstance(array.getClass().getComponentType(), array.length));
643 System.arraycopy(array, 0, copy, 0, array.length);
644 return copy;
645 }
646 return null;
647 }
648
649 /**
650 * Creates and returns a deep copy of a given array.
651 *
652 * @param array
653 * The array to copy or {@code null}.
654 * @return
655 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
656 */
657 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
658 private static char[] copyOf(final char[] array) {
659 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
660 if (array!= null) {
661 final char[] copy = ((char[]) Array.newInstance(array.getClass().getComponentType(), array.length));
662 System.arraycopy(array, 0, copy, 0, array.length);
663 return copy;
664 }
665 return null;
666 }
667
668 /**
669 * Creates and returns a deep copy of a given array.
670 *
671 * @param array
672 * The array to copy or {@code null}.
673 * @return
674 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
675 */
676 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
677 private static double[] copyOf(final double[] array) {
678 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
679 if (array!= null) {
680 final double[] copy = ((double[]) Array.newInstance(array.getClass().getComponentType(), array.length));
681 System.arraycopy(array, 0, copy, 0, array.length);
682 return copy;
683 }
684 return null;
685 }
686
687 /**
688 * Creates and returns a deep copy of a given array.
689 *
690 * @param array
691 * The array to copy or {@code null}.
692 * @return
693 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
694 */
695 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
696 private static float[] copyOf(final float[] array) {
697 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
698 if (array!= null) {
699 final float[] copy = ((float[]) Array.newInstance(array.getClass().getComponentType(), array.length));
700 System.arraycopy(array, 0, copy, 0, array.length);
701 return copy;
702 }
703 return null;
704 }
705
706 /**
707 * Creates and returns a deep copy of a given array.
708 *
709 * @param array
710 * The array to copy or {@code null}.
711 * @return
712 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
713 */
714 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
715 private static int[] copyOf(final int[] array) {
716 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
717 if (array!= null) {
718 final int[] copy = ((int[]) Array.newInstance(array.getClass().getComponentType(), array.length));
719 System.arraycopy(array, 0, copy, 0, array.length);
720 return copy;
721 }
722 return null;
723 }
724
725 /**
726 * Creates and returns a deep copy of a given array.
727 *
728 * @param array
729 * The array to copy or {@code null}.
730 * @return
731 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
732 */
733 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
734 private static long[] copyOf(final long[] array) {
735 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
736 if (array!= null) {
737 final long[] copy = ((long[]) Array.newInstance(array.getClass().getComponentType(), array.length));
738 System.arraycopy(array, 0, copy, 0, array.length);
739 return copy;
740 }
741 return null;
742 }
743
744 /**
745 * Creates and returns a deep copy of a given array.
746 *
747 * @param array
748 * The array to copy or {@code null}.
749 * @return
750 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
751 */
752 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
753 private static short[] copyOf(final short[] array) {
754 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
755 if (array!= null) {
756 final short[] copy = ((short[]) Array.newInstance(array.getClass().getComponentType(), array.length));
757 System.arraycopy(array, 0, copy, 0, array.length);
758 return copy;
759 }
760 return null;
761 }
762
763 /**
764 * Creates and returns a deep copy of a given {@code JAXBElement} instance.
765 *
766 * @param element
767 * The instance to copy or {@code null}.
768 * @return
769 * A deep copy of {@code element} or {@code null} if {@code element} is {@code null}.
770 */
771 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
772 private static JAXBElement copyOFJAXBElement(final JAXBElement element) {
773 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
774 if (element!= null) {
775 final JAXBElement copy = new JAXBElement(element.getName(), element.getDeclaredType(), element.getScope(), element.getValue());
776 copy.setNil(element.isNil());
777 copy.setValue(copyOfObject(copy.getValue()));
778 return copy;
779 }
780 return null;
781 }
782
783 /**
784 * Creates and returns a deep copy of a given {@code Serializable}.
785 *
786 * @param serializable
787 * The instance to copy or {@code null}.
788 * @return
789 * A deep copy of {@code serializable} or {@code null} if {@code serializable} is {@code null}.
790 */
791 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
792 private static Serializable copyOfSerializable(final Serializable serializable) {
793 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
794 if (serializable!= null) {
795 try {
796 final ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream();
797 final ObjectOutputStream out = new ObjectOutputStream(byteArrayOutput);
798 out.writeObject(serializable);
799 out.close();
800 final ByteArrayInputStream byteArrayInput = new ByteArrayInputStream(byteArrayOutput.toByteArray());
801 final ObjectInputStream in = new ObjectInputStream(byteArrayInput);
802 final Serializable copy = ((Serializable) in.readObject());
803 in.close();
804 return copy;
805 } catch (SecurityException e) {
806 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
807 } catch (ClassNotFoundException e) {
808 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
809 } catch (InvalidClassException e) {
810 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
811 } catch (NotSerializableException e) {
812 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
813 } catch (StreamCorruptedException e) {
814 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
815 } catch (OptionalDataException e) {
816 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
817 } catch (IOException e) {
818 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
819 }
820 }
821 return null;
822 }
823
824 /**
825 * Creates and returns a deep copy of this object.
826 *
827 *
828 * @return
829 * A deep copy of this object.
830 */
831 @Override
832 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
833 public Instance clone() {
834 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
835 return new Instance(this);
836 }
837
838 /** Maps dependency names to dependency objects. */
839 @javax.xml.bind.annotation.XmlTransient private java.util.Map<String, Object> dependencyObjects;
840
841 /** Maps property names to property objects. */
842 @javax.xml.bind.annotation.XmlTransient private java.util.Map<String, Object> propertyObjects;
843
844 /**
845 * Gets a mapping of dependency names to objects bound to the instance.
846 *
847 * @return A mapping of dependency names to objects bound to the instance.
848 */
849 public java.util.Map<String, Object> getDependencyObjects()
850 {
851 if ( this.dependencyObjects == null )
852 {
853 this.dependencyObjects = new java.util.HashMap<String, Object>();
854 }
855
856 return this.dependencyObjects;
857 }
858
859 /**
860 * Gets a mapping of property names to objects bound to the instance.
861 *
862 * @return A mapping of property names to objects bound to the instance.
863 */
864 public java.util.Map<String, Object> getPropertyObjects()
865 {
866 if ( this.propertyObjects == null )
867 {
868 this.propertyObjects = new java.util.HashMap<String, Object>();
869 }
870
871 return this.propertyObjects;
872 }
873
874
875 }