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