| 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.06.29 at 05:36:20 PM CEST |
| 6 | // |
| 7 | |
| 8 | |
| 9 | package org.jomc.sdk.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.HashMap; |
| 30 | import java.util.Iterator; |
| 31 | import java.util.List; |
| 32 | import java.util.Locale; |
| 33 | import java.util.Map; |
| 34 | import java.util.TimeZone; |
| 35 | import java.util.UUID; |
| 36 | import javax.annotation.Generated; |
| 37 | import javax.xml.bind.JAXBElement; |
| 38 | import javax.xml.bind.annotation.XmlAccessType; |
| 39 | import javax.xml.bind.annotation.XmlAccessorType; |
| 40 | import javax.xml.bind.annotation.XmlAnyAttribute; |
| 41 | import javax.xml.bind.annotation.XmlAnyElement; |
| 42 | import javax.xml.bind.annotation.XmlElement; |
| 43 | import javax.xml.bind.annotation.XmlType; |
| 44 | import javax.xml.datatype.Duration; |
| 45 | import javax.xml.datatype.XMLGregorianCalendar; |
| 46 | import javax.xml.namespace.QName; |
| 47 | import org.w3c.dom.Element; |
| 48 | |
| 49 | |
| 50 | /** |
| 51 | * The 'MapType' type declares a sequence of entries. |
| 52 | * |
| 53 | * <p>Java class for MapType complex type. |
| 54 | * |
| 55 | * <p>The following schema fragment specifies the expected content contained within this class. |
| 56 | * |
| 57 | * <pre> |
| 58 | * <complexType name="MapType"> |
| 59 | * <complexContent> |
| 60 | * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> |
| 61 | * <sequence> |
| 62 | * <element name="entry" maxOccurs="unbounded" minOccurs="0"> |
| 63 | * <complexType> |
| 64 | * <complexContent> |
| 65 | * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> |
| 66 | * <sequence> |
| 67 | * <element name="key" type="{http://jomc.org/sdk/model}ItemType"/> |
| 68 | * <element name="value" type="{http://jomc.org/sdk/model}ItemType" minOccurs="0"/> |
| 69 | * <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/> |
| 70 | * </sequence> |
| 71 | * </restriction> |
| 72 | * </complexContent> |
| 73 | * </complexType> |
| 74 | * </element> |
| 75 | * <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/> |
| 76 | * </sequence> |
| 77 | * <anyAttribute processContents='lax'/> |
| 78 | * </restriction> |
| 79 | * </complexContent> |
| 80 | * </complexType> |
| 81 | * </pre> |
| 82 | * |
| 83 | * |
| 84 | */ |
| 85 | @XmlAccessorType(XmlAccessType.FIELD) |
| 86 | @XmlType(name = "MapType", propOrder = { |
| 87 | "entry", |
| 88 | "any" |
| 89 | }) |
| 90 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 91 | public class MapType implements Cloneable |
| 92 | { |
| 93 | |
| 94 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 95 | protected List<MapType.Entry> entry; |
| 96 | @XmlAnyElement(lax = true) |
| 97 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 98 | protected List<Object> any; |
| 99 | @XmlAnyAttribute |
| 100 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 101 | private Map<QName, String> otherAttributes = new HashMap<QName, String>(); |
| 102 | |
| 103 | /** |
| 104 | * Creates a new {@code MapType} instance. |
| 105 | * |
| 106 | */ |
| 107 | public MapType() { |
| 108 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 109 | super(); |
| 110 | } |
| 111 | |
| 112 | /** |
| 113 | * Creates a new {@code MapType} instance by deeply copying a given {@code MapType} instance. |
| 114 | * |
| 115 | * |
| 116 | * @param o |
| 117 | * The instance to copy. |
| 118 | * @throws NullPointerException |
| 119 | * if {@code o} is {@code null}. |
| 120 | */ |
| 121 | public MapType(final MapType o) { |
| 122 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 123 | super(); |
| 124 | if (o == null) { |
| 125 | throw new NullPointerException("Cannot create a copy of 'MapType' from 'null'."); |
| 126 | } |
| 127 | // 'Entry' collection. |
| 128 | copyEntry(o.getEntry(), getEntry()); |
| 129 | // 'Any' collection. |
| 130 | copyAny(o.getAny(), getAny()); |
| 131 | // Other attributes. |
| 132 | this.otherAttributes.putAll(o.otherAttributes); |
| 133 | } |
| 134 | |
| 135 | /** |
| 136 | * Gets the value of the entry property. |
| 137 | * |
| 138 | * <p> |
| 139 | * This accessor method returns a reference to the live list, |
| 140 | * not a snapshot. Therefore any modification you make to the |
| 141 | * returned list will be present inside the JAXB object. |
| 142 | * This is why there is not a <CODE>set</CODE> method for the entry property. |
| 143 | * |
| 144 | * <p> |
| 145 | * For example, to add a new item, do as follows: |
| 146 | * <pre> |
| 147 | * getEntry().add(newItem); |
| 148 | * </pre> |
| 149 | * |
| 150 | * |
| 151 | * <p> |
| 152 | * Objects of the following type(s) are allowed in the list |
| 153 | * {@link MapType.Entry } |
| 154 | * |
| 155 | * |
| 156 | */ |
| 157 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 158 | public List<MapType.Entry> getEntry() { |
| 159 | if (entry == null) { |
| 160 | entry = new ArrayList<MapType.Entry>(); |
| 161 | } |
| 162 | return this.entry; |
| 163 | } |
| 164 | |
| 165 | /** |
| 166 | * Gets the value of the any property. |
| 167 | * |
| 168 | * <p> |
| 169 | * This accessor method returns a reference to the live list, |
| 170 | * not a snapshot. Therefore any modification you make to the |
| 171 | * returned list will be present inside the JAXB object. |
| 172 | * This is why there is not a <CODE>set</CODE> method for the any property. |
| 173 | * |
| 174 | * <p> |
| 175 | * For example, to add a new item, do as follows: |
| 176 | * <pre> |
| 177 | * getAny().add(newItem); |
| 178 | * </pre> |
| 179 | * |
| 180 | * |
| 181 | * <p> |
| 182 | * Objects of the following type(s) are allowed in the list |
| 183 | * {@link Element } |
| 184 | * {@link Object } |
| 185 | * |
| 186 | * |
| 187 | */ |
| 188 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 189 | public List<Object> getAny() { |
| 190 | if (any == null) { |
| 191 | any = new ArrayList<Object>(); |
| 192 | } |
| 193 | return this.any; |
| 194 | } |
| 195 | |
| 196 | /** |
| 197 | * Gets a map that contains attributes that aren't bound to any typed property on this class. |
| 198 | * |
| 199 | * <p> |
| 200 | * the map is keyed by the name of the attribute and |
| 201 | * the value is the string value of the attribute. |
| 202 | * |
| 203 | * the map returned by this method is live, and you can add new attribute |
| 204 | * by updating the map directly. Because of this design, there's no setter. |
| 205 | * |
| 206 | * |
| 207 | * @return |
| 208 | * always non-null |
| 209 | */ |
| 210 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 211 | public Map<QName, String> getOtherAttributes() { |
| 212 | return otherAttributes; |
| 213 | } |
| 214 | |
| 215 | /** |
| 216 | * Copies all values of property {@code Entry} deeply. |
| 217 | * |
| 218 | * @param target |
| 219 | * The target to copy {@code source} to. |
| 220 | * @param source |
| 221 | * The source to copy from. |
| 222 | * @throws NullPointerException |
| 223 | * if {@code source} or {@code target} is {@code null}. |
| 224 | */ |
| 225 | @SuppressWarnings("unchecked") |
| 226 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 227 | private static void copyEntry(final List<MapType.Entry> source, final List<MapType.Entry> target) { |
| 228 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 229 | if (!source.isEmpty()) { |
| 230 | for (Iterator it = source.iterator(); it.hasNext(); ) { |
| 231 | final Object next = it.next(); |
| 232 | if (next instanceof MapType.Entry) { |
| 233 | // CClassInfo: org.jomc.sdk.model.MapType$Entry |
| 234 | target.add(((MapType.Entry) next).clone()); |
| 235 | continue; |
| 236 | } |
| 237 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
| 238 | throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Entry' of class 'org.jomc.sdk.model.MapType'.")); |
| 239 | } |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | /** |
| 244 | * Copies all values of property {@code Any} deeply. |
| 245 | * |
| 246 | * @param target |
| 247 | * The target to copy {@code source} to. |
| 248 | * @param source |
| 249 | * The source to copy from. |
| 250 | * @throws NullPointerException |
| 251 | * if {@code source} or {@code target} is {@code null}. |
| 252 | */ |
| 253 | @SuppressWarnings("unchecked") |
| 254 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 255 | private static void copyAny(final List<Object> source, final List<Object> target) { |
| 256 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 257 | if (!source.isEmpty()) { |
| 258 | for (Iterator it = source.iterator(); it.hasNext(); ) { |
| 259 | final Object next = it.next(); |
| 260 | if (next instanceof Element) { |
| 261 | // CWildcardTypeInfo: org.w3c.dom.Element |
| 262 | target.add(((Element)((Element) next).cloneNode(true))); |
| 263 | continue; |
| 264 | } |
| 265 | if (next instanceof Object) { |
| 266 | // CBuiltinLeafInfo: java.lang.Object |
| 267 | target.add(copyOfObject(((Object) next))); |
| 268 | continue; |
| 269 | } |
| 270 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
| 271 | throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Any' of class 'org.jomc.sdk.model.MapType'.")); |
| 272 | } |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | /** |
| 277 | * Creates and returns a deep copy of a given object. |
| 278 | * |
| 279 | * @param o |
| 280 | * The instance to copy or {@code null}. |
| 281 | * @return |
| 282 | * A deep copy of {@code o} or {@code null} if {@code o} is {@code null}. |
| 283 | */ |
| 284 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 285 | private static Object copyOfObject(final Object o) { |
| 286 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 287 | if (o!= null) { |
| 288 | if (o.getClass().isPrimitive()) { |
| 289 | return o; |
| 290 | } |
| 291 | if (o.getClass().isArray()) { |
| 292 | return copyOfArray(o); |
| 293 | } |
| 294 | if (o instanceof Boolean) { |
| 295 | return o; |
| 296 | } |
| 297 | if (o instanceof Byte) { |
| 298 | return o; |
| 299 | } |
| 300 | if (o instanceof Character) { |
| 301 | return o; |
| 302 | } |
| 303 | if (o instanceof Double) { |
| 304 | return o; |
| 305 | } |
| 306 | if (o instanceof Enum) { |
| 307 | return o; |
| 308 | } |
| 309 | if (o instanceof Float) { |
| 310 | return o; |
| 311 | } |
| 312 | if (o instanceof Integer) { |
| 313 | return o; |
| 314 | } |
| 315 | if (o instanceof Long) { |
| 316 | return o; |
| 317 | } |
| 318 | if (o instanceof Short) { |
| 319 | return o; |
| 320 | } |
| 321 | if (o instanceof String) { |
| 322 | return o; |
| 323 | } |
| 324 | if (o instanceof BigDecimal) { |
| 325 | return o; |
| 326 | } |
| 327 | if (o instanceof BigInteger) { |
| 328 | return o; |
| 329 | } |
| 330 | if (o instanceof UUID) { |
| 331 | return o; |
| 332 | } |
| 333 | if (o instanceof QName) { |
| 334 | return o; |
| 335 | } |
| 336 | if (o instanceof Duration) { |
| 337 | return o; |
| 338 | } |
| 339 | if (o instanceof Currency) { |
| 340 | return o; |
| 341 | } |
| 342 | if (o instanceof XMLGregorianCalendar) { |
| 343 | return ((XMLGregorianCalendar) o).clone(); |
| 344 | } |
| 345 | if (o instanceof Date) { |
| 346 | return ((Date) o).clone(); |
| 347 | } |
| 348 | if (o instanceof Calendar) { |
| 349 | return ((Calendar) o).clone(); |
| 350 | } |
| 351 | if (o instanceof TimeZone) { |
| 352 | return ((TimeZone) o).clone(); |
| 353 | } |
| 354 | if (o instanceof Locale) { |
| 355 | return ((Locale) o).clone(); |
| 356 | } |
| 357 | if (o instanceof Element) { |
| 358 | return ((Element)((Element) o).cloneNode(true)); |
| 359 | } |
| 360 | if (o instanceof JAXBElement) { |
| 361 | return copyOFJAXBElement(((JAXBElement) o)); |
| 362 | } |
| 363 | try { |
| 364 | return o.getClass().getMethod("clone", ((Class[]) null)).invoke(o, ((Object[]) null)); |
| 365 | } catch (NoSuchMethodException e) { |
| 366 | if (o instanceof Serializable) { |
| 367 | return copyOfSerializable(((Serializable) o)); |
| 368 | } |
| 369 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
| 370 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); |
| 371 | } catch (IllegalAccessException e) { |
| 372 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
| 373 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); |
| 374 | } catch (InvocationTargetException e) { |
| 375 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
| 376 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); |
| 377 | } catch (SecurityException e) { |
| 378 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
| 379 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); |
| 380 | } catch (IllegalArgumentException e) { |
| 381 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
| 382 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); |
| 383 | } catch (ExceptionInInitializerError e) { |
| 384 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
| 385 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); |
| 386 | } |
| 387 | } |
| 388 | return null; |
| 389 | } |
| 390 | |
| 391 | /** |
| 392 | * Creates and returns a deep copy of a given array. |
| 393 | * |
| 394 | * @param array |
| 395 | * The array to copy or {@code null}. |
| 396 | * @return |
| 397 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
| 398 | */ |
| 399 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 400 | private static Object copyOfArray(final Object array) { |
| 401 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 402 | if (array!= null) { |
| 403 | if (array.getClass() == boolean[].class) { |
| 404 | return copyOf(((boolean[]) array)); |
| 405 | } |
| 406 | if (array.getClass() == byte[].class) { |
| 407 | return copyOf(((byte[]) array)); |
| 408 | } |
| 409 | if (array.getClass() == char[].class) { |
| 410 | return copyOf(((char[]) array)); |
| 411 | } |
| 412 | if (array.getClass() == double[].class) { |
| 413 | return copyOf(((double[]) array)); |
| 414 | } |
| 415 | if (array.getClass() == float[].class) { |
| 416 | return copyOf(((float[]) array)); |
| 417 | } |
| 418 | if (array.getClass() == int[].class) { |
| 419 | return copyOf(((int[]) array)); |
| 420 | } |
| 421 | if (array.getClass() == long[].class) { |
| 422 | return copyOf(((long[]) array)); |
| 423 | } |
| 424 | if (array.getClass() == short[].class) { |
| 425 | return copyOf(((short[]) array)); |
| 426 | } |
| 427 | final int len = Array.getLength(array); |
| 428 | final Object copy = Array.newInstance(array.getClass().getComponentType(), len); |
| 429 | for (int i = (len- 1); (i >= 0); i--) { |
| 430 | Array.set(copy, i, copyOfObject(Array.get(array, i))); |
| 431 | } |
| 432 | return copy; |
| 433 | } |
| 434 | return null; |
| 435 | } |
| 436 | |
| 437 | /** |
| 438 | * Creates and returns a deep copy of a given array. |
| 439 | * |
| 440 | * @param array |
| 441 | * The array to copy or {@code null}. |
| 442 | * @return |
| 443 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
| 444 | */ |
| 445 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 446 | private static boolean[] copyOf(final boolean[] array) { |
| 447 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 448 | if (array!= null) { |
| 449 | final boolean[] copy = ((boolean[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
| 450 | System.arraycopy(array, 0, copy, 0, array.length); |
| 451 | return copy; |
| 452 | } |
| 453 | return null; |
| 454 | } |
| 455 | |
| 456 | /** |
| 457 | * Creates and returns a deep copy of a given array. |
| 458 | * |
| 459 | * @param array |
| 460 | * The array to copy or {@code null}. |
| 461 | * @return |
| 462 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
| 463 | */ |
| 464 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 465 | private static byte[] copyOf(final byte[] array) { |
| 466 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 467 | if (array!= null) { |
| 468 | final byte[] copy = ((byte[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
| 469 | System.arraycopy(array, 0, copy, 0, array.length); |
| 470 | return copy; |
| 471 | } |
| 472 | return null; |
| 473 | } |
| 474 | |
| 475 | /** |
| 476 | * Creates and returns a deep copy of a given array. |
| 477 | * |
| 478 | * @param array |
| 479 | * The array to copy or {@code null}. |
| 480 | * @return |
| 481 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
| 482 | */ |
| 483 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 484 | private static char[] copyOf(final char[] array) { |
| 485 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 486 | if (array!= null) { |
| 487 | final char[] copy = ((char[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
| 488 | System.arraycopy(array, 0, copy, 0, array.length); |
| 489 | return copy; |
| 490 | } |
| 491 | return null; |
| 492 | } |
| 493 | |
| 494 | /** |
| 495 | * Creates and returns a deep copy of a given array. |
| 496 | * |
| 497 | * @param array |
| 498 | * The array to copy or {@code null}. |
| 499 | * @return |
| 500 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
| 501 | */ |
| 502 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 503 | private static double[] copyOf(final double[] array) { |
| 504 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 505 | if (array!= null) { |
| 506 | final double[] copy = ((double[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
| 507 | System.arraycopy(array, 0, copy, 0, array.length); |
| 508 | return copy; |
| 509 | } |
| 510 | return null; |
| 511 | } |
| 512 | |
| 513 | /** |
| 514 | * Creates and returns a deep copy of a given array. |
| 515 | * |
| 516 | * @param array |
| 517 | * The array to copy or {@code null}. |
| 518 | * @return |
| 519 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
| 520 | */ |
| 521 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 522 | private static float[] copyOf(final float[] array) { |
| 523 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 524 | if (array!= null) { |
| 525 | final float[] copy = ((float[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
| 526 | System.arraycopy(array, 0, copy, 0, array.length); |
| 527 | return copy; |
| 528 | } |
| 529 | return null; |
| 530 | } |
| 531 | |
| 532 | /** |
| 533 | * Creates and returns a deep copy of a given array. |
| 534 | * |
| 535 | * @param array |
| 536 | * The array to copy or {@code null}. |
| 537 | * @return |
| 538 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
| 539 | */ |
| 540 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 541 | private static int[] copyOf(final int[] array) { |
| 542 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 543 | if (array!= null) { |
| 544 | final int[] copy = ((int[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
| 545 | System.arraycopy(array, 0, copy, 0, array.length); |
| 546 | return copy; |
| 547 | } |
| 548 | return null; |
| 549 | } |
| 550 | |
| 551 | /** |
| 552 | * Creates and returns a deep copy of a given array. |
| 553 | * |
| 554 | * @param array |
| 555 | * The array to copy or {@code null}. |
| 556 | * @return |
| 557 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
| 558 | */ |
| 559 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 560 | private static long[] copyOf(final long[] array) { |
| 561 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 562 | if (array!= null) { |
| 563 | final long[] copy = ((long[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
| 564 | System.arraycopy(array, 0, copy, 0, array.length); |
| 565 | return copy; |
| 566 | } |
| 567 | return null; |
| 568 | } |
| 569 | |
| 570 | /** |
| 571 | * Creates and returns a deep copy of a given array. |
| 572 | * |
| 573 | * @param array |
| 574 | * The array to copy or {@code null}. |
| 575 | * @return |
| 576 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
| 577 | */ |
| 578 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 579 | private static short[] copyOf(final short[] array) { |
| 580 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 581 | if (array!= null) { |
| 582 | final short[] copy = ((short[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
| 583 | System.arraycopy(array, 0, copy, 0, array.length); |
| 584 | return copy; |
| 585 | } |
| 586 | return null; |
| 587 | } |
| 588 | |
| 589 | /** |
| 590 | * Creates and returns a deep copy of a given {@code JAXBElement} instance. |
| 591 | * |
| 592 | * @param element |
| 593 | * The instance to copy or {@code null}. |
| 594 | * @return |
| 595 | * A deep copy of {@code element} or {@code null} if {@code element} is {@code null}. |
| 596 | */ |
| 597 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 598 | private static JAXBElement copyOFJAXBElement(final JAXBElement element) { |
| 599 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 600 | if (element!= null) { |
| 601 | final JAXBElement copy = new JAXBElement(element.getName(), element.getDeclaredType(), element.getScope(), element.getValue()); |
| 602 | copy.setNil(element.isNil()); |
| 603 | copy.setValue(copyOfObject(copy.getValue())); |
| 604 | return copy; |
| 605 | } |
| 606 | return null; |
| 607 | } |
| 608 | |
| 609 | /** |
| 610 | * Creates and returns a deep copy of a given {@code Serializable}. |
| 611 | * |
| 612 | * @param serializable |
| 613 | * The instance to copy or {@code null}. |
| 614 | * @return |
| 615 | * A deep copy of {@code serializable} or {@code null} if {@code serializable} is {@code null}. |
| 616 | */ |
| 617 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 618 | private static Serializable copyOfSerializable(final Serializable serializable) { |
| 619 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 620 | if (serializable!= null) { |
| 621 | try { |
| 622 | final ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream(); |
| 623 | final ObjectOutputStream out = new ObjectOutputStream(byteArrayOutput); |
| 624 | out.writeObject(serializable); |
| 625 | out.close(); |
| 626 | final ByteArrayInputStream byteArrayInput = new ByteArrayInputStream(byteArrayOutput.toByteArray()); |
| 627 | final ObjectInputStream in = new ObjectInputStream(byteArrayInput); |
| 628 | final Serializable copy = ((Serializable) in.readObject()); |
| 629 | in.close(); |
| 630 | return copy; |
| 631 | } catch (SecurityException e) { |
| 632 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
| 633 | } catch (ClassNotFoundException e) { |
| 634 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
| 635 | } catch (InvalidClassException e) { |
| 636 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
| 637 | } catch (NotSerializableException e) { |
| 638 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
| 639 | } catch (StreamCorruptedException e) { |
| 640 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
| 641 | } catch (OptionalDataException e) { |
| 642 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
| 643 | } catch (IOException e) { |
| 644 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
| 645 | } |
| 646 | } |
| 647 | return null; |
| 648 | } |
| 649 | |
| 650 | /** |
| 651 | * Creates and returns a deep copy of this object. |
| 652 | * |
| 653 | * |
| 654 | * @return |
| 655 | * A deep copy of this object. |
| 656 | */ |
| 657 | @Override |
| 658 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 659 | public MapType clone() { |
| 660 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 661 | return new MapType(this); |
| 662 | } |
| 663 | |
| 664 | |
| 665 | /** |
| 666 | * <p>Java class for anonymous complex type. |
| 667 | * |
| 668 | * <p>The following schema fragment specifies the expected content contained within this class. |
| 669 | * |
| 670 | * <pre> |
| 671 | * <complexType> |
| 672 | * <complexContent> |
| 673 | * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> |
| 674 | * <sequence> |
| 675 | * <element name="key" type="{http://jomc.org/sdk/model}ItemType"/> |
| 676 | * <element name="value" type="{http://jomc.org/sdk/model}ItemType" minOccurs="0"/> |
| 677 | * <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/> |
| 678 | * </sequence> |
| 679 | * </restriction> |
| 680 | * </complexContent> |
| 681 | * </complexType> |
| 682 | * </pre> |
| 683 | * |
| 684 | * |
| 685 | */ |
| 686 | @XmlAccessorType(XmlAccessType.FIELD) |
| 687 | @XmlType(name = "", propOrder = { |
| 688 | "key", |
| 689 | "value", |
| 690 | "any" |
| 691 | }) |
| 692 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 693 | public static class Entry implements Cloneable |
| 694 | { |
| 695 | |
| 696 | @XmlElement(required = true) |
| 697 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 698 | protected ItemType key; |
| 699 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 700 | protected ItemType value; |
| 701 | @XmlAnyElement(lax = true) |
| 702 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 703 | protected List<Object> any; |
| 704 | |
| 705 | /** |
| 706 | * Creates a new {@code Entry} instance. |
| 707 | * |
| 708 | */ |
| 709 | public Entry() { |
| 710 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 711 | super(); |
| 712 | } |
| 713 | |
| 714 | /** |
| 715 | * Creates a new {@code Entry} instance by deeply copying a given {@code Entry} instance. |
| 716 | * |
| 717 | * |
| 718 | * @param o |
| 719 | * The instance to copy. |
| 720 | * @throws NullPointerException |
| 721 | * if {@code o} is {@code null}. |
| 722 | */ |
| 723 | public Entry(final MapType.Entry o) { |
| 724 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 725 | super(); |
| 726 | if (o == null) { |
| 727 | throw new NullPointerException("Cannot create a copy of 'Entry' from 'null'."); |
| 728 | } |
| 729 | // CClassInfo: org.jomc.sdk.model.ItemType |
| 730 | this.key = ((o.getKey() == null)?null:o.getKey().clone()); |
| 731 | // CClassInfo: org.jomc.sdk.model.ItemType |
| 732 | this.value = ((o.getValue() == null)?null:o.getValue().clone()); |
| 733 | // 'Any' collection. |
| 734 | copyAny(o.getAny(), getAny()); |
| 735 | } |
| 736 | |
| 737 | /** |
| 738 | * The key of the entry. |
| 739 | * |
| 740 | * @return |
| 741 | * possible object is |
| 742 | * {@link ItemType } |
| 743 | * |
| 744 | */ |
| 745 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 746 | public ItemType getKey() { |
| 747 | return key; |
| 748 | } |
| 749 | |
| 750 | /** |
| 751 | * Sets the value of the key property. |
| 752 | * |
| 753 | * @param value |
| 754 | * allowed object is |
| 755 | * {@link ItemType } |
| 756 | * |
| 757 | */ |
| 758 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 759 | public void setKey(ItemType value) { |
| 760 | this.key = value; |
| 761 | } |
| 762 | |
| 763 | /** |
| 764 | * The value of the entry. |
| 765 | * |
| 766 | * @return |
| 767 | * possible object is |
| 768 | * {@link ItemType } |
| 769 | * |
| 770 | */ |
| 771 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 772 | public ItemType getValue() { |
| 773 | return value; |
| 774 | } |
| 775 | |
| 776 | /** |
| 777 | * Sets the value of the value property. |
| 778 | * |
| 779 | * @param value |
| 780 | * allowed object is |
| 781 | * {@link ItemType } |
| 782 | * |
| 783 | */ |
| 784 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 785 | public void setValue(ItemType value) { |
| 786 | this.value = value; |
| 787 | } |
| 788 | |
| 789 | /** |
| 790 | * Gets the value of the any property. |
| 791 | * |
| 792 | * <p> |
| 793 | * This accessor method returns a reference to the live list, |
| 794 | * not a snapshot. Therefore any modification you make to the |
| 795 | * returned list will be present inside the JAXB object. |
| 796 | * This is why there is not a <CODE>set</CODE> method for the any property. |
| 797 | * |
| 798 | * <p> |
| 799 | * For example, to add a new item, do as follows: |
| 800 | * <pre> |
| 801 | * getAny().add(newItem); |
| 802 | * </pre> |
| 803 | * |
| 804 | * |
| 805 | * <p> |
| 806 | * Objects of the following type(s) are allowed in the list |
| 807 | * {@link Element } |
| 808 | * {@link Object } |
| 809 | * |
| 810 | * |
| 811 | */ |
| 812 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 813 | public List<Object> getAny() { |
| 814 | if (any == null) { |
| 815 | any = new ArrayList<Object>(); |
| 816 | } |
| 817 | return this.any; |
| 818 | } |
| 819 | |
| 820 | /** |
| 821 | * Copies all values of property {@code Any} deeply. |
| 822 | * |
| 823 | * @param target |
| 824 | * The target to copy {@code source} to. |
| 825 | * @param source |
| 826 | * The source to copy from. |
| 827 | * @throws NullPointerException |
| 828 | * if {@code source} or {@code target} is {@code null}. |
| 829 | */ |
| 830 | @SuppressWarnings("unchecked") |
| 831 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 832 | private static void copyAny(final List<Object> source, final List<Object> target) { |
| 833 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 834 | if (!source.isEmpty()) { |
| 835 | for (Iterator it = source.iterator(); it.hasNext(); ) { |
| 836 | final Object next = it.next(); |
| 837 | if (next instanceof Element) { |
| 838 | // CWildcardTypeInfo: org.w3c.dom.Element |
| 839 | target.add(((Element)((Element) next).cloneNode(true))); |
| 840 | continue; |
| 841 | } |
| 842 | if (next instanceof Object) { |
| 843 | // CBuiltinLeafInfo: java.lang.Object |
| 844 | target.add(copyOfObject(((Object) next))); |
| 845 | continue; |
| 846 | } |
| 847 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
| 848 | throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Any' of class 'org.jomc.sdk.model.MapType$Entry'.")); |
| 849 | } |
| 850 | } |
| 851 | } |
| 852 | |
| 853 | /** |
| 854 | * Creates and returns a deep copy of a given object. |
| 855 | * |
| 856 | * @param o |
| 857 | * The instance to copy or {@code null}. |
| 858 | * @return |
| 859 | * A deep copy of {@code o} or {@code null} if {@code o} is {@code null}. |
| 860 | */ |
| 861 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 862 | private static Object copyOfObject(final Object o) { |
| 863 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 864 | if (o!= null) { |
| 865 | if (o.getClass().isPrimitive()) { |
| 866 | return o; |
| 867 | } |
| 868 | if (o.getClass().isArray()) { |
| 869 | return copyOfArray(o); |
| 870 | } |
| 871 | if (o instanceof Boolean) { |
| 872 | return o; |
| 873 | } |
| 874 | if (o instanceof Byte) { |
| 875 | return o; |
| 876 | } |
| 877 | if (o instanceof Character) { |
| 878 | return o; |
| 879 | } |
| 880 | if (o instanceof Double) { |
| 881 | return o; |
| 882 | } |
| 883 | if (o instanceof Enum) { |
| 884 | return o; |
| 885 | } |
| 886 | if (o instanceof Float) { |
| 887 | return o; |
| 888 | } |
| 889 | if (o instanceof Integer) { |
| 890 | return o; |
| 891 | } |
| 892 | if (o instanceof Long) { |
| 893 | return o; |
| 894 | } |
| 895 | if (o instanceof Short) { |
| 896 | return o; |
| 897 | } |
| 898 | if (o instanceof String) { |
| 899 | return o; |
| 900 | } |
| 901 | if (o instanceof BigDecimal) { |
| 902 | return o; |
| 903 | } |
| 904 | if (o instanceof BigInteger) { |
| 905 | return o; |
| 906 | } |
| 907 | if (o instanceof UUID) { |
| 908 | return o; |
| 909 | } |
| 910 | if (o instanceof QName) { |
| 911 | return o; |
| 912 | } |
| 913 | if (o instanceof Duration) { |
| 914 | return o; |
| 915 | } |
| 916 | if (o instanceof Currency) { |
| 917 | return o; |
| 918 | } |
| 919 | if (o instanceof XMLGregorianCalendar) { |
| 920 | return ((XMLGregorianCalendar) o).clone(); |
| 921 | } |
| 922 | if (o instanceof Date) { |
| 923 | return ((Date) o).clone(); |
| 924 | } |
| 925 | if (o instanceof Calendar) { |
| 926 | return ((Calendar) o).clone(); |
| 927 | } |
| 928 | if (o instanceof TimeZone) { |
| 929 | return ((TimeZone) o).clone(); |
| 930 | } |
| 931 | if (o instanceof Locale) { |
| 932 | return ((Locale) o).clone(); |
| 933 | } |
| 934 | if (o instanceof Element) { |
| 935 | return ((Element)((Element) o).cloneNode(true)); |
| 936 | } |
| 937 | if (o instanceof JAXBElement) { |
| 938 | return copyOFJAXBElement(((JAXBElement) o)); |
| 939 | } |
| 940 | try { |
| 941 | return o.getClass().getMethod("clone", ((Class[]) null)).invoke(o, ((Object[]) null)); |
| 942 | } catch (NoSuchMethodException e) { |
| 943 | if (o instanceof Serializable) { |
| 944 | return copyOfSerializable(((Serializable) o)); |
| 945 | } |
| 946 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
| 947 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); |
| 948 | } catch (IllegalAccessException e) { |
| 949 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
| 950 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); |
| 951 | } catch (InvocationTargetException e) { |
| 952 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
| 953 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); |
| 954 | } catch (SecurityException e) { |
| 955 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
| 956 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); |
| 957 | } catch (IllegalArgumentException e) { |
| 958 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
| 959 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); |
| 960 | } catch (ExceptionInInitializerError e) { |
| 961 | // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ |
| 962 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); |
| 963 | } |
| 964 | } |
| 965 | return null; |
| 966 | } |
| 967 | |
| 968 | /** |
| 969 | * Creates and returns a deep copy of a given array. |
| 970 | * |
| 971 | * @param array |
| 972 | * The array to copy or {@code null}. |
| 973 | * @return |
| 974 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
| 975 | */ |
| 976 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 977 | private static Object copyOfArray(final Object array) { |
| 978 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 979 | if (array!= null) { |
| 980 | if (array.getClass() == boolean[].class) { |
| 981 | return copyOf(((boolean[]) array)); |
| 982 | } |
| 983 | if (array.getClass() == byte[].class) { |
| 984 | return copyOf(((byte[]) array)); |
| 985 | } |
| 986 | if (array.getClass() == char[].class) { |
| 987 | return copyOf(((char[]) array)); |
| 988 | } |
| 989 | if (array.getClass() == double[].class) { |
| 990 | return copyOf(((double[]) array)); |
| 991 | } |
| 992 | if (array.getClass() == float[].class) { |
| 993 | return copyOf(((float[]) array)); |
| 994 | } |
| 995 | if (array.getClass() == int[].class) { |
| 996 | return copyOf(((int[]) array)); |
| 997 | } |
| 998 | if (array.getClass() == long[].class) { |
| 999 | return copyOf(((long[]) array)); |
| 1000 | } |
| 1001 | if (array.getClass() == short[].class) { |
| 1002 | return copyOf(((short[]) array)); |
| 1003 | } |
| 1004 | final int len = Array.getLength(array); |
| 1005 | final Object copy = Array.newInstance(array.getClass().getComponentType(), len); |
| 1006 | for (int i = (len- 1); (i >= 0); i--) { |
| 1007 | Array.set(copy, i, copyOfObject(Array.get(array, i))); |
| 1008 | } |
| 1009 | return copy; |
| 1010 | } |
| 1011 | return null; |
| 1012 | } |
| 1013 | |
| 1014 | /** |
| 1015 | * Creates and returns a deep copy of a given array. |
| 1016 | * |
| 1017 | * @param array |
| 1018 | * The array to copy or {@code null}. |
| 1019 | * @return |
| 1020 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
| 1021 | */ |
| 1022 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 1023 | private static boolean[] copyOf(final boolean[] array) { |
| 1024 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 1025 | if (array!= null) { |
| 1026 | final boolean[] copy = ((boolean[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
| 1027 | System.arraycopy(array, 0, copy, 0, array.length); |
| 1028 | return copy; |
| 1029 | } |
| 1030 | return null; |
| 1031 | } |
| 1032 | |
| 1033 | /** |
| 1034 | * Creates and returns a deep copy of a given array. |
| 1035 | * |
| 1036 | * @param array |
| 1037 | * The array to copy or {@code null}. |
| 1038 | * @return |
| 1039 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
| 1040 | */ |
| 1041 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 1042 | private static byte[] copyOf(final byte[] array) { |
| 1043 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 1044 | if (array!= null) { |
| 1045 | final byte[] copy = ((byte[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
| 1046 | System.arraycopy(array, 0, copy, 0, array.length); |
| 1047 | return copy; |
| 1048 | } |
| 1049 | return null; |
| 1050 | } |
| 1051 | |
| 1052 | /** |
| 1053 | * Creates and returns a deep copy of a given array. |
| 1054 | * |
| 1055 | * @param array |
| 1056 | * The array to copy or {@code null}. |
| 1057 | * @return |
| 1058 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
| 1059 | */ |
| 1060 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 1061 | private static char[] copyOf(final char[] array) { |
| 1062 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 1063 | if (array!= null) { |
| 1064 | final char[] copy = ((char[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
| 1065 | System.arraycopy(array, 0, copy, 0, array.length); |
| 1066 | return copy; |
| 1067 | } |
| 1068 | return null; |
| 1069 | } |
| 1070 | |
| 1071 | /** |
| 1072 | * Creates and returns a deep copy of a given array. |
| 1073 | * |
| 1074 | * @param array |
| 1075 | * The array to copy or {@code null}. |
| 1076 | * @return |
| 1077 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
| 1078 | */ |
| 1079 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 1080 | private static double[] copyOf(final double[] array) { |
| 1081 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 1082 | if (array!= null) { |
| 1083 | final double[] copy = ((double[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
| 1084 | System.arraycopy(array, 0, copy, 0, array.length); |
| 1085 | return copy; |
| 1086 | } |
| 1087 | return null; |
| 1088 | } |
| 1089 | |
| 1090 | /** |
| 1091 | * Creates and returns a deep copy of a given array. |
| 1092 | * |
| 1093 | * @param array |
| 1094 | * The array to copy or {@code null}. |
| 1095 | * @return |
| 1096 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
| 1097 | */ |
| 1098 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 1099 | private static float[] copyOf(final float[] array) { |
| 1100 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 1101 | if (array!= null) { |
| 1102 | final float[] copy = ((float[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
| 1103 | System.arraycopy(array, 0, copy, 0, array.length); |
| 1104 | return copy; |
| 1105 | } |
| 1106 | return null; |
| 1107 | } |
| 1108 | |
| 1109 | /** |
| 1110 | * Creates and returns a deep copy of a given array. |
| 1111 | * |
| 1112 | * @param array |
| 1113 | * The array to copy or {@code null}. |
| 1114 | * @return |
| 1115 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
| 1116 | */ |
| 1117 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 1118 | private static int[] copyOf(final int[] array) { |
| 1119 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 1120 | if (array!= null) { |
| 1121 | final int[] copy = ((int[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
| 1122 | System.arraycopy(array, 0, copy, 0, array.length); |
| 1123 | return copy; |
| 1124 | } |
| 1125 | return null; |
| 1126 | } |
| 1127 | |
| 1128 | /** |
| 1129 | * Creates and returns a deep copy of a given array. |
| 1130 | * |
| 1131 | * @param array |
| 1132 | * The array to copy or {@code null}. |
| 1133 | * @return |
| 1134 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
| 1135 | */ |
| 1136 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 1137 | private static long[] copyOf(final long[] array) { |
| 1138 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 1139 | if (array!= null) { |
| 1140 | final long[] copy = ((long[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
| 1141 | System.arraycopy(array, 0, copy, 0, array.length); |
| 1142 | return copy; |
| 1143 | } |
| 1144 | return null; |
| 1145 | } |
| 1146 | |
| 1147 | /** |
| 1148 | * Creates and returns a deep copy of a given array. |
| 1149 | * |
| 1150 | * @param array |
| 1151 | * The array to copy or {@code null}. |
| 1152 | * @return |
| 1153 | * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. |
| 1154 | */ |
| 1155 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 1156 | private static short[] copyOf(final short[] array) { |
| 1157 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 1158 | if (array!= null) { |
| 1159 | final short[] copy = ((short[]) Array.newInstance(array.getClass().getComponentType(), array.length)); |
| 1160 | System.arraycopy(array, 0, copy, 0, array.length); |
| 1161 | return copy; |
| 1162 | } |
| 1163 | return null; |
| 1164 | } |
| 1165 | |
| 1166 | /** |
| 1167 | * Creates and returns a deep copy of a given {@code JAXBElement} instance. |
| 1168 | * |
| 1169 | * @param element |
| 1170 | * The instance to copy or {@code null}. |
| 1171 | * @return |
| 1172 | * A deep copy of {@code element} or {@code null} if {@code element} is {@code null}. |
| 1173 | */ |
| 1174 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 1175 | private static JAXBElement copyOFJAXBElement(final JAXBElement element) { |
| 1176 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 1177 | if (element!= null) { |
| 1178 | final JAXBElement copy = new JAXBElement(element.getName(), element.getDeclaredType(), element.getScope(), element.getValue()); |
| 1179 | copy.setNil(element.isNil()); |
| 1180 | copy.setValue(copyOfObject(copy.getValue())); |
| 1181 | return copy; |
| 1182 | } |
| 1183 | return null; |
| 1184 | } |
| 1185 | |
| 1186 | /** |
| 1187 | * Creates and returns a deep copy of a given {@code Serializable}. |
| 1188 | * |
| 1189 | * @param serializable |
| 1190 | * The instance to copy or {@code null}. |
| 1191 | * @return |
| 1192 | * A deep copy of {@code serializable} or {@code null} if {@code serializable} is {@code null}. |
| 1193 | */ |
| 1194 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 1195 | private static Serializable copyOfSerializable(final Serializable serializable) { |
| 1196 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 1197 | if (serializable!= null) { |
| 1198 | try { |
| 1199 | final ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream(); |
| 1200 | final ObjectOutputStream out = new ObjectOutputStream(byteArrayOutput); |
| 1201 | out.writeObject(serializable); |
| 1202 | out.close(); |
| 1203 | final ByteArrayInputStream byteArrayInput = new ByteArrayInputStream(byteArrayOutput.toByteArray()); |
| 1204 | final ObjectInputStream in = new ObjectInputStream(byteArrayInput); |
| 1205 | final Serializable copy = ((Serializable) in.readObject()); |
| 1206 | in.close(); |
| 1207 | return copy; |
| 1208 | } catch (SecurityException e) { |
| 1209 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
| 1210 | } catch (ClassNotFoundException e) { |
| 1211 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
| 1212 | } catch (InvalidClassException e) { |
| 1213 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
| 1214 | } catch (NotSerializableException e) { |
| 1215 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
| 1216 | } catch (StreamCorruptedException e) { |
| 1217 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
| 1218 | } catch (OptionalDataException e) { |
| 1219 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
| 1220 | } catch (IOException e) { |
| 1221 | throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); |
| 1222 | } |
| 1223 | } |
| 1224 | return null; |
| 1225 | } |
| 1226 | |
| 1227 | /** |
| 1228 | * Creates and returns a deep copy of this object. |
| 1229 | * |
| 1230 | * |
| 1231 | * @return |
| 1232 | * A deep copy of this object. |
| 1233 | */ |
| 1234 | @Override |
| 1235 | @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T05:36:20+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833") |
| 1236 | public MapType.Entry clone() { |
| 1237 | // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000 |
| 1238 | return new MapType.Entry(this); |
| 1239 | } |
| 1240 | |
| 1241 | } |
| 1242 | |
| 1243 | /** |
| 1244 | * Gets the Java value of this type. |
| 1245 | * |
| 1246 | * @param classLoader The class loader to use for getting the Java value; {@code null} to use the platform's |
| 1247 | * bootstrap class loader. |
| 1248 | * |
| 1249 | * @return The Java value of this type. |
| 1250 | * |
| 1251 | * @throws org.jomc.model.PropertyException if getting the Java value fails. |
| 1252 | */ |
| 1253 | public java.util.Map getJavaValue( final ClassLoader classLoader ) throws org.jomc.model.PropertyException |
| 1254 | { |
| 1255 | final java.util.Map javaValue = new java.util.HashMap( this.getEntry().size() ); |
| 1256 | |
| 1257 | for ( MapType.Entry e : this.getEntry() ) |
| 1258 | { |
| 1259 | javaValue.put( ReflectionHelper.getJavaValue( classLoader, e.getKey() ), |
| 1260 | ReflectionHelper.getJavaValue( classLoader, e.getValue() ) ); |
| 1261 | |
| 1262 | } |
| 1263 | |
| 1264 | return java.util.Collections.unmodifiableMap( javaValue ); |
| 1265 | } |
| 1266 | |
| 1267 | |
| 1268 | } |