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