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 a dependency.
052 *
053 * The 'Dependency' type extends the 'SpecificationReference' type adding attributes 'implementationName', 'name',
054 * 'bound' and 'optional'. Attribute 'implementationName' holds an identifier selecting a single implementation from the
055 * set of implementations implementing the referenced specification. Attribute 'name' holds an identifier uniquely
056 * identifying the dependency in a set of dependencies. Attribute 'bound' flags the instances of the dependency bound
057 * to the declaring implementation. Attribute 'optional' flags a dependency optional. Properties set with a dependency
058 * override properties of the selected implementations.
059 *
060 *
061 * <p>Java class for Dependency complex type.
062 *
063 * <p>The following schema fragment specifies the expected content contained within this class.
064 *
065 * <pre>
066 * <complexType name="Dependency">
067 * <complexContent>
068 * <extension base="{http://jomc.org/model}SpecificationReference">
069 * <sequence>
070 * <element ref="{http://jomc.org/model}properties" minOccurs="0"/>
071 * <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
072 * </sequence>
073 * <attribute name="implementationName" type="{http://jomc.org/model}Identifier" />
074 * <attribute name="name" use="required" type="{http://jomc.org/model}Identifier" />
075 * <attribute name="bound" type="{http://jomc.org/model}Flag" default="true" />
076 * <attribute name="optional" type="{http://jomc.org/model}Flag" default="false" />
077 * </extension>
078 * </complexContent>
079 * </complexType>
080 * </pre>
081 *
082 *
083 */
084 @XmlAccessorType(XmlAccessType.FIELD)
085 @XmlType(name = "Dependency", propOrder = {
086 "properties",
087 "any"
088 })
089 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
090 public class Dependency
091 extends SpecificationReference
092 implements Cloneable
093 {
094
095 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
096 protected Properties properties;
097 @XmlAnyElement(lax = true)
098 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
099 protected List<Object> any;
100 @XmlAttribute
101 @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
102 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
103 protected String implementationName;
104 @XmlAttribute(required = true)
105 @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
106 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
107 protected String name;
108 @XmlAttribute
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 Boolean bound;
111 @XmlAttribute
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 Boolean optional;
114
115 /**
116 * Creates a new {@code Dependency} instance.
117 *
118 */
119 public Dependency() {
120 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
121 super();
122 }
123
124 /**
125 * Creates a new {@code Dependency} instance by deeply copying a given {@code Dependency} instance.
126 *
127 *
128 * @param o
129 * The instance to copy.
130 * @throws NullPointerException
131 * if {@code o} is {@code null}.
132 */
133 public Dependency(final Dependency o) {
134 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
135 super(o);
136 if (o == null) {
137 throw new NullPointerException("Cannot create a copy of 'Dependency' from 'null'.");
138 }
139 // CClassInfo: org.jomc.model.Properties
140 this.properties = ((o.getProperties() == null)?null:o.getProperties().clone());
141 // 'Any' collection.
142 copyAny(o.getAny(), getAny());
143 // CBuiltinLeafInfo: java.lang.String
144 this.implementationName = o.getImplementationName();
145 // CBuiltinLeafInfo: java.lang.String
146 this.name = o.getName();
147 // CBuiltinLeafInfo: java.lang.Boolean
148 this.bound = o.isBound();
149 // CBuiltinLeafInfo: java.lang.Boolean
150 this.optional = o.isOptional();
151 }
152
153 /**
154 * Properties of this dependency or {@code null}.
155 *
156 * @return
157 * possible object is
158 * {@link Properties }
159 *
160 */
161 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
162 public Properties getProperties() {
163 return properties;
164 }
165
166 /**
167 * Sets the value of the properties property.
168 *
169 * @param value
170 * allowed object is
171 * {@link Properties }
172 *
173 */
174 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
175 public void setProperties(Properties value) {
176 this.properties = value;
177 }
178
179 /**
180 * Gets the value of the any property.
181 *
182 * <p>
183 * This accessor method returns a reference to the live list,
184 * not a snapshot. Therefore any modification you make to the
185 * returned list will be present inside the JAXB object.
186 * This is why there is not a <CODE>set</CODE> method for the any property.
187 *
188 * <p>
189 * For example, to add a new item, do as follows:
190 * <pre>
191 * getAny().add(newItem);
192 * </pre>
193 *
194 *
195 * <p>
196 * Objects of the following type(s) are allowed in the list
197 * {@link Element }
198 * {@link Object }
199 *
200 *
201 */
202 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
203 public List<Object> getAny() {
204 if (any == null) {
205 any = new ArrayList<Object>();
206 }
207 return this.any;
208 }
209
210 /**
211 * Name of the selected implementation of the specification of this dependency or {@code null}.
212 *
213 * @return
214 * possible object is
215 * {@link String }
216 *
217 */
218 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
219 public String getImplementationName() {
220 return implementationName;
221 }
222
223 /**
224 * Sets the value of the implementationName property.
225 *
226 * @param value
227 * allowed object is
228 * {@link String }
229 *
230 */
231 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
232 public void setImplementationName(String value) {
233 this.implementationName = value;
234 }
235
236 /**
237 * Name of this dependency.
238 *
239 * @return
240 * possible object is
241 * {@link String }
242 *
243 */
244 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
245 public String getName() {
246 return name;
247 }
248
249 /**
250 * Sets the value of the name property.
251 *
252 * @param value
253 * allowed object is
254 * {@link String }
255 *
256 */
257 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
258 public void setName(String value) {
259 this.name = value;
260 }
261
262 /**
263 * {@code true} if instances of this dependency are bound to the declaring implementation.
264 *
265 * @return
266 * possible object is
267 * {@link Boolean }
268 *
269 */
270 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
271 public boolean isBound() {
272 if (bound == null) {
273 return true;
274 } else {
275 return bound;
276 }
277 }
278
279 /**
280 * Sets the value of the bound property.
281 *
282 * @param value
283 * allowed object is
284 * {@link Boolean }
285 *
286 */
287 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
288 public void setBound(Boolean value) {
289 this.bound = value;
290 }
291
292 /**
293 * {@code true} if this dependency is optional.
294 *
295 * @return
296 * possible object is
297 * {@link Boolean }
298 *
299 */
300 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
301 public boolean isOptional() {
302 if (optional == null) {
303 return false;
304 } else {
305 return optional;
306 }
307 }
308
309 /**
310 * Sets the value of the optional property.
311 *
312 * @param value
313 * allowed object is
314 * {@link Boolean }
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 void setOptional(Boolean value) {
319 this.optional = value;
320 }
321
322 /**
323 * Copies all values of property {@code Any} deeply.
324 *
325 * @param target
326 * The target to copy {@code source} to.
327 * @param source
328 * The source to copy from.
329 * @throws NullPointerException
330 * if {@code source} or {@code target} is {@code null}.
331 */
332 @SuppressWarnings("unchecked")
333 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
334 private static void copyAny(final List<Object> source, final List<Object> target) {
335 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
336 if (!source.isEmpty()) {
337 for (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(copyOfObject(((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.model.Dependency'."));
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 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
364 private static Object copyOfObject(final Object o) {
365 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
366 if (o!= null) {
367 if (o.getClass().isPrimitive()) {
368 return o;
369 }
370 if (o.getClass().isArray()) {
371 return copyOfArray(o);
372 }
373 if (o instanceof Boolean) {
374 return o;
375 }
376 if (o instanceof Byte) {
377 return o;
378 }
379 if (o instanceof Character) {
380 return o;
381 }
382 if (o instanceof Double) {
383 return o;
384 }
385 if (o instanceof Enum) {
386 return o;
387 }
388 if (o instanceof Float) {
389 return o;
390 }
391 if (o instanceof Integer) {
392 return o;
393 }
394 if (o instanceof Long) {
395 return o;
396 }
397 if (o instanceof Short) {
398 return o;
399 }
400 if (o instanceof String) {
401 return o;
402 }
403 if (o instanceof BigDecimal) {
404 return o;
405 }
406 if (o instanceof BigInteger) {
407 return o;
408 }
409 if (o instanceof UUID) {
410 return o;
411 }
412 if (o instanceof QName) {
413 return o;
414 }
415 if (o instanceof Duration) {
416 return o;
417 }
418 if (o instanceof Currency) {
419 return o;
420 }
421 if (o instanceof XMLGregorianCalendar) {
422 return ((XMLGregorianCalendar) o).clone();
423 }
424 if (o instanceof Date) {
425 return ((Date) o).clone();
426 }
427 if (o instanceof Calendar) {
428 return ((Calendar) o).clone();
429 }
430 if (o instanceof TimeZone) {
431 return ((TimeZone) o).clone();
432 }
433 if (o instanceof Locale) {
434 return ((Locale) o).clone();
435 }
436 if (o instanceof Element) {
437 return ((Element)((Element) o).cloneNode(true));
438 }
439 if (o instanceof JAXBElement) {
440 return copyOFJAXBElement(((JAXBElement) o));
441 }
442 try {
443 return o.getClass().getMethod("clone", ((Class[]) null)).invoke(o, ((Object[]) null));
444 } catch (NoSuchMethodException e) {
445 if (o instanceof Serializable) {
446 return copyOfSerializable(((Serializable) o));
447 }
448 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
449 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
450 } catch (IllegalAccessException e) {
451 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
452 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
453 } catch (InvocationTargetException e) {
454 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
455 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
456 } catch (SecurityException e) {
457 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
458 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
459 } catch (IllegalArgumentException e) {
460 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
461 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
462 } catch (ExceptionInInitializerError e) {
463 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
464 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e));
465 }
466 }
467 return null;
468 }
469
470 /**
471 * Creates and returns a deep copy of a given array.
472 *
473 * @param array
474 * The array to copy or {@code null}.
475 * @return
476 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
477 */
478 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
479 private static Object copyOfArray(final Object array) {
480 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
481 if (array!= null) {
482 if (array.getClass() == boolean[].class) {
483 return copyOf(((boolean[]) array));
484 }
485 if (array.getClass() == byte[].class) {
486 return copyOf(((byte[]) array));
487 }
488 if (array.getClass() == char[].class) {
489 return copyOf(((char[]) array));
490 }
491 if (array.getClass() == double[].class) {
492 return copyOf(((double[]) array));
493 }
494 if (array.getClass() == float[].class) {
495 return copyOf(((float[]) array));
496 }
497 if (array.getClass() == int[].class) {
498 return copyOf(((int[]) array));
499 }
500 if (array.getClass() == long[].class) {
501 return copyOf(((long[]) array));
502 }
503 if (array.getClass() == short[].class) {
504 return copyOf(((short[]) array));
505 }
506 final int len = Array.getLength(array);
507 final Object copy = Array.newInstance(array.getClass().getComponentType(), len);
508 for (int i = (len- 1); (i >= 0); i--) {
509 Array.set(copy, i, copyOfObject(Array.get(array, i)));
510 }
511 return copy;
512 }
513 return null;
514 }
515
516 /**
517 * Creates and returns a deep copy of a given array.
518 *
519 * @param array
520 * The array to copy or {@code null}.
521 * @return
522 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
523 */
524 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
525 private static boolean[] copyOf(final boolean[] array) {
526 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
527 if (array!= null) {
528 final boolean[] copy = ((boolean[]) Array.newInstance(array.getClass().getComponentType(), array.length));
529 System.arraycopy(array, 0, copy, 0, array.length);
530 return copy;
531 }
532 return null;
533 }
534
535 /**
536 * Creates and returns a deep copy of a given array.
537 *
538 * @param array
539 * The array to copy or {@code null}.
540 * @return
541 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
542 */
543 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
544 private static byte[] copyOf(final byte[] array) {
545 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
546 if (array!= null) {
547 final byte[] copy = ((byte[]) Array.newInstance(array.getClass().getComponentType(), array.length));
548 System.arraycopy(array, 0, copy, 0, array.length);
549 return copy;
550 }
551 return null;
552 }
553
554 /**
555 * Creates and returns a deep copy of a given array.
556 *
557 * @param array
558 * The array to copy or {@code null}.
559 * @return
560 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
561 */
562 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
563 private static char[] copyOf(final char[] array) {
564 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
565 if (array!= null) {
566 final char[] copy = ((char[]) Array.newInstance(array.getClass().getComponentType(), array.length));
567 System.arraycopy(array, 0, copy, 0, array.length);
568 return copy;
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 = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
582 private static double[] copyOf(final double[] array) {
583 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
584 if (array!= null) {
585 final double[] copy = ((double[]) Array.newInstance(array.getClass().getComponentType(), array.length));
586 System.arraycopy(array, 0, copy, 0, array.length);
587 return copy;
588 }
589 return null;
590 }
591
592 /**
593 * Creates and returns a deep copy of a given array.
594 *
595 * @param array
596 * The array to copy or {@code null}.
597 * @return
598 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}.
599 */
600 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
601 private static float[] copyOf(final float[] array) {
602 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
603 if (array!= null) {
604 final float[] copy = ((float[]) Array.newInstance(array.getClass().getComponentType(), array.length));
605 System.arraycopy(array, 0, copy, 0, array.length);
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 int[] copyOf(final int[] array) {
621 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
622 if (array!= null) {
623 final int[] copy = ((int[]) 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 long[] copyOf(final long[] array) {
640 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
641 if (array!= null) {
642 final long[] copy = ((long[]) 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 short[] copyOf(final short[] array) {
659 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
660 if (array!= null) {
661 final short[] copy = ((short[]) 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 {@code JAXBElement} instance.
670 *
671 * @param element
672 * The instance to copy or {@code null}.
673 * @return
674 * A deep copy of {@code element} or {@code null} if {@code element} 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 JAXBElement copyOFJAXBElement(final JAXBElement element) {
678 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
679 if (element!= null) {
680 final JAXBElement copy = new JAXBElement(element.getName(), element.getDeclaredType(), element.getScope(), element.getValue());
681 copy.setNil(element.isNil());
682 copy.setValue(copyOfObject(copy.getValue()));
683 return copy;
684 }
685 return null;
686 }
687
688 /**
689 * Creates and returns a deep copy of a given {@code Serializable}.
690 *
691 * @param serializable
692 * The instance to copy or {@code null}.
693 * @return
694 * A deep copy of {@code serializable} or {@code null} if {@code serializable} is {@code null}.
695 */
696 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
697 private static Serializable copyOfSerializable(final Serializable serializable) {
698 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
699 if (serializable!= null) {
700 try {
701 final ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream();
702 final ObjectOutputStream out = new ObjectOutputStream(byteArrayOutput);
703 out.writeObject(serializable);
704 out.close();
705 final ByteArrayInputStream byteArrayInput = new ByteArrayInputStream(byteArrayOutput.toByteArray());
706 final ObjectInputStream in = new ObjectInputStream(byteArrayInput);
707 final Serializable copy = ((Serializable) in.readObject());
708 in.close();
709 return copy;
710 } catch (SecurityException e) {
711 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
712 } catch (ClassNotFoundException e) {
713 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
714 } catch (InvalidClassException e) {
715 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
716 } catch (NotSerializableException e) {
717 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
718 } catch (StreamCorruptedException e) {
719 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
720 } catch (OptionalDataException e) {
721 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
722 } catch (IOException e) {
723 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e));
724 }
725 }
726 return null;
727 }
728
729 /**
730 * Creates and returns a deep copy of this object.
731 *
732 *
733 * @return
734 * A deep copy of this object.
735 */
736 @Override
737 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
738 public Dependency clone() {
739 // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
740 return new Dependency(this);
741 }
742
743 }