001// 002// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-2 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: 2016.11.01 at 03:16:38 AM CET 006// 007 008 009package org.jomc.model; 010 011import java.io.ByteArrayInputStream; 012import java.io.ByteArrayOutputStream; 013import java.io.File; 014import java.io.IOException; 015import java.io.InvalidClassException; 016import java.io.NotSerializableException; 017import java.io.ObjectInputStream; 018import java.io.ObjectOutputStream; 019import java.io.OptionalDataException; 020import java.io.Serializable; 021import java.io.StreamCorruptedException; 022import java.lang.reflect.Array; 023import java.lang.reflect.InvocationTargetException; 024import java.math.BigDecimal; 025import java.math.BigInteger; 026import java.net.MalformedURLException; 027import java.net.URI; 028import java.net.URISyntaxException; 029import java.net.URL; 030import java.util.ArrayList; 031import java.util.Calendar; 032import java.util.Currency; 033import java.util.Date; 034import java.util.Iterator; 035import java.util.List; 036import java.util.Locale; 037import java.util.TimeZone; 038import java.util.UUID; 039import javax.activation.MimeType; 040import javax.activation.MimeTypeParseException; 041import javax.annotation.Generated; 042import javax.xml.bind.JAXBElement; 043import javax.xml.bind.annotation.XmlAccessType; 044import javax.xml.bind.annotation.XmlAccessorType; 045import javax.xml.bind.annotation.XmlAnyElement; 046import javax.xml.bind.annotation.XmlAttribute; 047import javax.xml.bind.annotation.XmlElement; 048import javax.xml.bind.annotation.XmlType; 049import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; 050import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; 051import javax.xml.datatype.Duration; 052import javax.xml.datatype.XMLGregorianCalendar; 053import javax.xml.namespace.QName; 054import org.w3c.dom.Element; 055 056 057/** 058 * 059 * Model of a dependency. 060 * 061 * The 'Dependency' type extends the 'SpecificationReference' type adding attributes 'implementationName', 'name', 062 * 'bound' and 'optional'. Attribute 'implementationName' holds an identifier selecting a single implementation from the 063 * set of implementations implementing the referenced specification. Attribute 'name' holds an identifier uniquely 064 * identifying the dependency in a set of dependencies. Attribute 'bound' flags the instances of the dependency bound 065 * to the declaring implementation. Attribute 'optional' flags a dependency optional. Dependencies, messages and properties 066 * set with a dependency override dependencies, messages and properties of the selected implementations. 067 * 068 * 069 * <p>Java class for Dependency complex type. 070 * 071 * <p>The following schema fragment specifies the expected content contained within this class. 072 * 073 * <pre> 074 * <complexType name="Dependency"> 075 * <complexContent> 076 * <extension base="{http://jomc.org/model}SpecificationReference"> 077 * <sequence> 078 * <element ref="{http://jomc.org/model}dependencies" minOccurs="0"/> 079 * <element ref="{http://jomc.org/model}properties" minOccurs="0"/> 080 * <element ref="{http://jomc.org/model}messages" minOccurs="0"/> 081 * <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/> 082 * </sequence> 083 * <attribute name="implementationName" type="{http://jomc.org/model}Identifier" /> 084 * <attribute name="name" use="required" type="{http://jomc.org/model}Identifier" /> 085 * <attribute name="bound" type="{http://jomc.org/model}Flag" default="true" /> 086 * <attribute name="optional" type="{http://jomc.org/model}Flag" default="false" /> 087 * </extension> 088 * </complexContent> 089 * </complexType> 090 * </pre> 091 * 092 * 093 */ 094@XmlAccessorType(XmlAccessType.FIELD) 095@XmlType(name = "Dependency", namespace = "http://jomc.org/model", propOrder = { 096 "dependencies", 097 "properties", 098 "messages", 099 "any" 100}) 101@Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 102public class Dependency 103 extends SpecificationReference 104 implements Cloneable 105{ 106 107 @XmlElement(namespace = "http://jomc.org/model") 108 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 109 protected Dependencies dependencies; 110 @XmlElement(namespace = "http://jomc.org/model") 111 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 112 protected Properties properties; 113 @XmlElement(namespace = "http://jomc.org/model") 114 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 115 protected Messages messages; 116 @XmlAnyElement(lax = true) 117 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 118 protected List<Object> any; 119 @XmlAttribute(name = "implementationName") 120 @XmlJavaTypeAdapter(CollapsedStringAdapter.class) 121 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 122 protected String implementationName; 123 @XmlAttribute(name = "name", required = true) 124 @XmlJavaTypeAdapter(CollapsedStringAdapter.class) 125 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 126 protected String name; 127 @XmlAttribute(name = "bound") 128 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 129 protected Boolean bound; 130 @XmlAttribute(name = "optional") 131 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 132 protected Boolean optional; 133 134 /** 135 * Creates a new {@code Dependency} instance. 136 * 137 */ 138 public Dependency() { 139 // CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000 140 super(); 141 } 142 143 /** 144 * Creates a new {@code Dependency} instance by deeply copying a given {@code Dependency} instance. 145 * 146 * 147 * @param o 148 * The instance to copy. 149 * @throws NullPointerException 150 * if {@code o} is {@code null}. 151 */ 152 public Dependency(final Dependency o) { 153 // CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000 154 super(o); 155 if (o == null) { 156 throw new NullPointerException("Cannot create a copy of 'Dependency' from 'null'."); 157 } 158 // CClassInfo: org.jomc.model.Dependencies 159 this.dependencies = ((o.dependencies == null)?null:((o.getDependencies() == null)?null:o.getDependencies().clone())); 160 // CClassInfo: org.jomc.model.Properties 161 this.properties = ((o.properties == null)?null:((o.getProperties() == null)?null:o.getProperties().clone())); 162 // CClassInfo: org.jomc.model.Messages 163 this.messages = ((o.messages == null)?null:((o.getMessages() == null)?null:o.getMessages().clone())); 164 // 'Any' collection. 165 if (o.any!= null) { 166 copyAny(o.getAny(), this.getAny()); 167 } 168 // CBuiltinLeafInfo: java.lang.String 169 this.implementationName = ((o.implementationName == null)?null:o.getImplementationName()); 170 // CBuiltinLeafInfo: java.lang.String 171 this.name = ((o.name == null)?null:o.getName()); 172 // CBuiltinLeafInfo: java.lang.Boolean 173 this.bound = ((o.bound == null)?null:o.isBound()); 174 // CBuiltinLeafInfo: java.lang.Boolean 175 this.optional = ((o.optional == null)?null:o.isOptional()); 176 } 177 178 /** 179 * Dependencies of this dependency or {@code null}. 180 * 181 * @return 182 * possible object is 183 * {@link Dependencies } 184 * 185 */ 186 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 187 public Dependencies getDependencies() { 188 return dependencies; 189 } 190 191 /** 192 * Sets the value of the dependencies property. 193 * 194 * @param value 195 * allowed object is 196 * {@link Dependencies } 197 * 198 */ 199 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 200 public void setDependencies(Dependencies value) { 201 this.dependencies = value; 202 } 203 204 /** 205 * Properties of this dependency or {@code null}. 206 * 207 * @return 208 * possible object is 209 * {@link Properties } 210 * 211 */ 212 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 213 public Properties getProperties() { 214 return properties; 215 } 216 217 /** 218 * Sets the value of the properties property. 219 * 220 * @param value 221 * allowed object is 222 * {@link Properties } 223 * 224 */ 225 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 226 public void setProperties(Properties value) { 227 this.properties = value; 228 } 229 230 /** 231 * Messages of this dependency or {@code null}. 232 * 233 * @return 234 * possible object is 235 * {@link Messages } 236 * 237 */ 238 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 239 public Messages getMessages() { 240 return messages; 241 } 242 243 /** 244 * Sets the value of the messages property. 245 * 246 * @param value 247 * allowed object is 248 * {@link Messages } 249 * 250 */ 251 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 252 public void setMessages(Messages value) { 253 this.messages = value; 254 } 255 256 /** 257 * Gets the value of the any property. 258 * 259 * <p> 260 * This accessor method returns a reference to the live list, 261 * not a snapshot. Therefore any modification you make to the 262 * returned list will be present inside the JAXB object. 263 * This is why there is not a <CODE>set</CODE> method for the any property. 264 * 265 * <p> 266 * For example, to add a new item, do as follows: 267 * <pre> 268 * getAny().add(newItem); 269 * </pre> 270 * 271 * 272 * <p> 273 * Objects of the following type(s) are allowed in the list 274 * {@link Object } 275 * {@link Element } 276 * 277 * 278 */ 279 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 280 public List<Object> getAny() { 281 if (any == null) { 282 any = new ArrayList<Object>(); 283 } 284 return this.any; 285 } 286 287 /** 288 * Name of the selected implementation of the specification of this dependency or {@code null}. 289 * 290 * @return 291 * possible object is 292 * {@link String } 293 * 294 */ 295 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 296 public String getImplementationName() { 297 return implementationName; 298 } 299 300 /** 301 * Sets the value of the implementationName property. 302 * 303 * @param value 304 * allowed object is 305 * {@link String } 306 * 307 */ 308 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 309 public void setImplementationName(String value) { 310 this.implementationName = value; 311 } 312 313 /** 314 * Name of this dependency. 315 * 316 * @return 317 * possible object is 318 * {@link String } 319 * 320 */ 321 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 322 public String getName() { 323 return name; 324 } 325 326 /** 327 * Sets the value of the name property. 328 * 329 * @param value 330 * allowed object is 331 * {@link String } 332 * 333 */ 334 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 335 public void setName(String value) { 336 this.name = value; 337 } 338 339 /** 340 * {@code true}, if instances of this dependency are bound to the declaring implementation. 341 * 342 * @return 343 * possible object is 344 * {@link Boolean } 345 * 346 */ 347 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 348 public boolean isBound() { 349 if (bound == null) { 350 return true; 351 } else { 352 return bound; 353 } 354 } 355 356 /** 357 * Sets the value of the bound property. 358 * 359 * @param value 360 * allowed object is 361 * {@link Boolean } 362 * 363 */ 364 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 365 public void setBound(Boolean value) { 366 this.bound = value; 367 } 368 369 /** 370 * {@code true}, if this dependency is optional. 371 * 372 * @return 373 * possible object is 374 * {@link Boolean } 375 * 376 */ 377 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 378 public boolean isOptional() { 379 if (optional == null) { 380 return false; 381 } else { 382 return optional; 383 } 384 } 385 386 /** 387 * Sets the value of the optional property. 388 * 389 * @param value 390 * allowed object is 391 * {@link Boolean } 392 * 393 */ 394 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 395 public void setOptional(Boolean value) { 396 this.optional = value; 397 } 398 399 /** 400 * Copies all values of property {@code Any} deeply. 401 * 402 * @param source 403 * The source to copy from. 404 * @param target 405 * The target to copy {@code source} to. 406 * @throws NullPointerException 407 * if {@code target} is {@code null}. 408 */ 409 @SuppressWarnings("unchecked") 410 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 411 private static void copyAny(final List<Object> source, final List<Object> target) { 412 // CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000 413 if ((source!= null)&&(!source.isEmpty())) { 414 for (final Iterator<?> it = source.iterator(); it.hasNext(); ) { 415 final Object next = it.next(); 416 if (next instanceof Element) { 417 // CWildcardTypeInfo: org.w3c.dom.Element 418 target.add(((Element)((Element) next).cloneNode(true))); 419 continue; 420 } 421 if (next instanceof Object) { 422 // CBuiltinLeafInfo: java.lang.Object 423 target.add(copyOf(((Object) next))); 424 continue; 425 } 426 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ 427 throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Any' of class 'org.jomc.model.Dependency'.")); 428 } 429 } 430 } 431 432 /** 433 * Creates and returns a deep copy of a given object. 434 * 435 * @param o 436 * The instance to copy or {@code null}. 437 * @return 438 * A deep copy of {@code o} or {@code null} if {@code o} is {@code null}. 439 */ 440 @SuppressWarnings("unchecked") 441 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 442 private static Object copyOf(final Object o) { 443 // CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000 444 try { 445 if (o!= null) { 446 if (o.getClass().isPrimitive()) { 447 return o; 448 } 449 if (o.getClass().isArray()) { 450 return copyOfArray(o); 451 } 452 // Immutable types. 453 if (o instanceof Boolean) { 454 return o; 455 } 456 if (o instanceof Byte) { 457 return o; 458 } 459 if (o instanceof Character) { 460 return o; 461 } 462 if (o instanceof Double) { 463 return o; 464 } 465 if (o instanceof Enum) { 466 return o; 467 } 468 if (o instanceof Float) { 469 return o; 470 } 471 if (o instanceof Integer) { 472 return o; 473 } 474 if (o instanceof Long) { 475 return o; 476 } 477 if (o instanceof Short) { 478 return o; 479 } 480 if (o instanceof String) { 481 return o; 482 } 483 if (o instanceof BigDecimal) { 484 return o; 485 } 486 if (o instanceof BigInteger) { 487 return o; 488 } 489 if (o instanceof UUID) { 490 return o; 491 } 492 if (o instanceof QName) { 493 return o; 494 } 495 if (o instanceof Duration) { 496 return o; 497 } 498 if (o instanceof Currency) { 499 return o; 500 } 501 // String based types. 502 if (o instanceof File) { 503 return new File(o.toString()); 504 } 505 if (o instanceof URI) { 506 return new URI(o.toString()); 507 } 508 if (o instanceof URL) { 509 return new URL(o.toString()); 510 } 511 if (o instanceof MimeType) { 512 return new MimeType(o.toString()); 513 } 514 // Cloneable types. 515 if (o instanceof XMLGregorianCalendar) { 516 return ((XMLGregorianCalendar) o).clone(); 517 } 518 if (o instanceof Date) { 519 return ((Date) o).clone(); 520 } 521 if (o instanceof Calendar) { 522 return ((Calendar) o).clone(); 523 } 524 if (o instanceof TimeZone) { 525 return ((TimeZone) o).clone(); 526 } 527 if (o instanceof Locale) { 528 return ((Locale) o).clone(); 529 } 530 if (o instanceof Element) { 531 return ((Element)((Element) o).cloneNode(true)); 532 } 533 if (o instanceof JAXBElement) { 534 return copyOf(((JAXBElement) o)); 535 } 536 try { 537 return o.getClass().getMethod("clone", ((Class[]) null)).invoke(o, ((Object[]) null)); 538 } catch (NoSuchMethodException e) { 539 if (o instanceof Serializable) { 540 return copyOf(((Serializable) o)); 541 } 542 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ 543 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); 544 } catch (IllegalAccessException e) { 545 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ 546 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); 547 } catch (InvocationTargetException e) { 548 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ 549 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); 550 } catch (SecurityException e) { 551 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ 552 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); 553 } catch (IllegalArgumentException e) { 554 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ 555 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); 556 } catch (ExceptionInInitializerError e) { 557 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/ 558 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); 559 } 560 } 561 return null; 562 } catch (MalformedURLException e) { 563 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); 564 } catch (MimeTypeParseException e) { 565 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); 566 } catch (URISyntaxException e) { 567 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ o)+"'.")).initCause(e)); 568 } 569 } 570 571 /** 572 * Creates and returns a deep copy of a given array. 573 * 574 * @param array 575 * The array to copy or {@code null}. 576 * @return 577 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. 578 */ 579 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 580 private static Object copyOfArray(final Object array) { 581 // CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000 582 if (array!= null) { 583 if (array.getClass() == boolean[].class) { 584 return copyOf(((boolean[]) array)); 585 } 586 if (array.getClass() == byte[].class) { 587 return copyOf(((byte[]) array)); 588 } 589 if (array.getClass() == char[].class) { 590 return copyOf(((char[]) array)); 591 } 592 if (array.getClass() == double[].class) { 593 return copyOf(((double[]) array)); 594 } 595 if (array.getClass() == float[].class) { 596 return copyOf(((float[]) array)); 597 } 598 if (array.getClass() == int[].class) { 599 return copyOf(((int[]) array)); 600 } 601 if (array.getClass() == long[].class) { 602 return copyOf(((long[]) array)); 603 } 604 if (array.getClass() == short[].class) { 605 return copyOf(((short[]) array)); 606 } 607 final int len = Array.getLength(array); 608 final Object copy = Array.newInstance(array.getClass().getComponentType(), len); 609 for (int i = (len- 1); (i >= 0); i--) { 610 Array.set(copy, i, copyOf(Array.get(array, i))); 611 } 612 return copy; 613 } 614 return null; 615 } 616 617 /** 618 * Creates and returns a deep copy of a given array. 619 * 620 * @param array 621 * The array to copy or {@code null}. 622 * @return 623 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. 624 */ 625 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 626 private static boolean[] copyOf(final boolean[] array) { 627 // CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000 628 if (array!= null) { 629 final boolean[] copy = ((boolean[]) Array.newInstance(array.getClass().getComponentType(), array.length)); 630 System.arraycopy(array, 0, copy, 0, array.length); 631 return copy; 632 } 633 return null; 634 } 635 636 /** 637 * Creates and returns a deep copy of a given array. 638 * 639 * @param array 640 * The array to copy or {@code null}. 641 * @return 642 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. 643 */ 644 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 645 private static byte[] copyOf(final byte[] array) { 646 // CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000 647 if (array!= null) { 648 final byte[] copy = ((byte[]) Array.newInstance(array.getClass().getComponentType(), array.length)); 649 System.arraycopy(array, 0, copy, 0, array.length); 650 return copy; 651 } 652 return null; 653 } 654 655 /** 656 * Creates and returns a deep copy of a given array. 657 * 658 * @param array 659 * The array to copy or {@code null}. 660 * @return 661 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. 662 */ 663 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 664 private static char[] copyOf(final char[] array) { 665 // CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000 666 if (array!= null) { 667 final char[] copy = ((char[]) Array.newInstance(array.getClass().getComponentType(), array.length)); 668 System.arraycopy(array, 0, copy, 0, array.length); 669 return copy; 670 } 671 return null; 672 } 673 674 /** 675 * Creates and returns a deep copy of a given array. 676 * 677 * @param array 678 * The array to copy or {@code null}. 679 * @return 680 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. 681 */ 682 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 683 private static double[] copyOf(final double[] array) { 684 // CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000 685 if (array!= null) { 686 final double[] copy = ((double[]) Array.newInstance(array.getClass().getComponentType(), array.length)); 687 System.arraycopy(array, 0, copy, 0, array.length); 688 return copy; 689 } 690 return null; 691 } 692 693 /** 694 * Creates and returns a deep copy of a given array. 695 * 696 * @param array 697 * The array to copy or {@code null}. 698 * @return 699 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. 700 */ 701 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 702 private static float[] copyOf(final float[] array) { 703 // CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000 704 if (array!= null) { 705 final float[] copy = ((float[]) Array.newInstance(array.getClass().getComponentType(), array.length)); 706 System.arraycopy(array, 0, copy, 0, array.length); 707 return copy; 708 } 709 return null; 710 } 711 712 /** 713 * Creates and returns a deep copy of a given array. 714 * 715 * @param array 716 * The array to copy or {@code null}. 717 * @return 718 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. 719 */ 720 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 721 private static int[] copyOf(final int[] array) { 722 // CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000 723 if (array!= null) { 724 final int[] copy = ((int[]) Array.newInstance(array.getClass().getComponentType(), array.length)); 725 System.arraycopy(array, 0, copy, 0, array.length); 726 return copy; 727 } 728 return null; 729 } 730 731 /** 732 * Creates and returns a deep copy of a given array. 733 * 734 * @param array 735 * The array to copy or {@code null}. 736 * @return 737 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. 738 */ 739 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 740 private static long[] copyOf(final long[] array) { 741 // CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000 742 if (array!= null) { 743 final long[] copy = ((long[]) Array.newInstance(array.getClass().getComponentType(), array.length)); 744 System.arraycopy(array, 0, copy, 0, array.length); 745 return copy; 746 } 747 return null; 748 } 749 750 /** 751 * Creates and returns a deep copy of a given array. 752 * 753 * @param array 754 * The array to copy or {@code null}. 755 * @return 756 * A deep copy of {@code array} or {@code null} if {@code array} is {@code null}. 757 */ 758 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 759 private static short[] copyOf(final short[] array) { 760 // CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000 761 if (array!= null) { 762 final short[] copy = ((short[]) Array.newInstance(array.getClass().getComponentType(), array.length)); 763 System.arraycopy(array, 0, copy, 0, array.length); 764 return copy; 765 } 766 return null; 767 } 768 769 /** 770 * Creates and returns a deep copy of a given {@code JAXBElement} instance. 771 * 772 * @param element 773 * The instance to copy or {@code null}. 774 * @return 775 * A deep copy of {@code element} or {@code null} if {@code element} is {@code null}. 776 */ 777 @SuppressWarnings("unchecked") 778 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 779 private static JAXBElement copyOf(final JAXBElement element) { 780 // CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000 781 if (element!= null) { 782 final JAXBElement copy = new JAXBElement(element.getName(), element.getDeclaredType(), element.getScope(), element.getValue()); 783 copy.setNil(element.isNil()); 784 copy.setValue(copyOf(copy.getValue())); 785 return copy; 786 } 787 return null; 788 } 789 790 /** 791 * Creates and returns a deep copy of a given {@code Serializable}. 792 * 793 * @param serializable 794 * The instance to copy or {@code null}. 795 * @return 796 * A deep copy of {@code serializable} or {@code null} if {@code serializable} is {@code null}. 797 */ 798 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 799 private static Serializable copyOf(final Serializable serializable) { 800 // CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000 801 if (serializable!= null) { 802 try { 803 final ByteArrayOutputStream byteArrayOutput = new ByteArrayOutputStream(); 804 final ObjectOutputStream out = new ObjectOutputStream(byteArrayOutput); 805 out.writeObject(serializable); 806 out.close(); 807 final ByteArrayInputStream byteArrayInput = new ByteArrayInputStream(byteArrayOutput.toByteArray()); 808 final ObjectInputStream in = new ObjectInputStream(byteArrayInput); 809 final Serializable copy = ((Serializable) in.readObject()); 810 in.close(); 811 return copy; 812 } catch (SecurityException e) { 813 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); 814 } catch (ClassNotFoundException e) { 815 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); 816 } catch (InvalidClassException e) { 817 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); 818 } catch (NotSerializableException e) { 819 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); 820 } catch (StreamCorruptedException e) { 821 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); 822 } catch (OptionalDataException e) { 823 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); 824 } catch (IOException e) { 825 throw((AssertionError) new AssertionError((("Unexpected instance during copying object '"+ serializable)+"'.")).initCause(e)); 826 } 827 } 828 return null; 829 } 830 831 /** 832 * Creates and returns a deep copy of this object. 833 * 834 * 835 * @return 836 * A deep copy of this object. 837 */ 838 @Override 839 @Generated(value = "com.sun.tools.xjc.Driver", date = "2016-11-01T03:16:37+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2") 840 public Dependency clone() { 841 { 842 // CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000 843 final Dependency clone = ((Dependency) super.clone()); 844 // CClassInfo: org.jomc.model.Dependencies 845 clone.dependencies = ((this.dependencies == null)?null:((this.getDependencies() == null)?null:this.getDependencies().clone())); 846 // CClassInfo: org.jomc.model.Properties 847 clone.properties = ((this.properties == null)?null:((this.getProperties() == null)?null:this.getProperties().clone())); 848 // CClassInfo: org.jomc.model.Messages 849 clone.messages = ((this.messages == null)?null:((this.getMessages() == null)?null:this.getMessages().clone())); 850 // 'Any' collection. 851 if (this.any!= null) { 852 clone.any = null; 853 copyAny(this.getAny(), clone.getAny()); 854 } 855 // CBuiltinLeafInfo: java.lang.String 856 clone.implementationName = ((this.implementationName == null)?null:this.getImplementationName()); 857 // CBuiltinLeafInfo: java.lang.String 858 clone.name = ((this.name == null)?null:this.getName()); 859 // CBuiltinLeafInfo: java.lang.Boolean 860 clone.bound = ((this.bound == null)?null:this.isBound()); 861 // CBuiltinLeafInfo: java.lang.Boolean 862 clone.optional = ((this.optional == null)?null:this.isOptional()); 863 return clone; 864 } 865 } 866 867 /** 868 * Gets the Java getter method name of the dependency. 869 * 870 * @return The Java getter method name of the dependency. 871 * 872 * @throws ModelObjectException if compiling the name of the dependency to a {@code JavaIdentifier} fails. 873 * 874 * @since 1.4 875 * 876 * @see #getName() 877 */ 878 public JavaIdentifier getJavaGetterMethodName() throws ModelObjectException 879 { 880 try 881 { 882 return JavaIdentifier.parse( "get" + JavaIdentifier.normalize( 883 this.getName() != null ? this.getName() : "", JavaIdentifier.NormalizationMode.CAMEL_CASE ) ); 884 885 } 886 catch ( final java.text.ParseException e ) 887 { 888 throw new ModelObjectException( getMessage( "javaIdentifierParseException", this.getName(), 889 getMessage( e ) ), e ); 890 891 } 892 } 893 894 /** 895 * Gets the Java setter method name of the dependency. 896 * 897 * @return The Java setter method name of the dependency. 898 * 899 * @throws ModelObjectException if compiling the name of the dependency to a {@code JavaIdentifier} fails. 900 * 901 * @since 1.4 902 * 903 * @see #getName() 904 */ 905 public JavaIdentifier getJavaSetterMethodName() throws ModelObjectException 906 { 907 try 908 { 909 return JavaIdentifier.parse( "set" + JavaIdentifier.normalize( 910 this.getName() != null ? this.getName() : "", JavaIdentifier.NormalizationMode.CAMEL_CASE ) ); 911 912 } 913 catch ( final java.text.ParseException e ) 914 { 915 throw new ModelObjectException( getMessage( "javaIdentifierParseException", this.getName(), 916 getMessage( e ) ), e ); 917 918 } 919 } 920 921 /** 922 * Gets the Java variable name of the dependency. 923 * 924 * @return The Java variable name of the dependency. 925 * 926 * @throws ModelObjectException if compiling the name of the dependency to a {@code JavaIdentifier} fails. 927 * 928 * @since 1.4 929 * 930 * @see #getName() 931 */ 932 public JavaIdentifier getJavaVariableName() throws ModelObjectException 933 { 934 try 935 { 936 return JavaIdentifier.normalize( this.getName() != null ? this.getName() : "", 937 JavaIdentifier.NormalizationMode.VARIABLE_NAME_CONVENTION ); 938 939 } 940 catch ( final java.text.ParseException e ) 941 { 942 throw new ModelObjectException( getMessage( "javaIdentifierParseException", this.getName(), 943 getMessage( e ) ), e ); 944 945 } 946 } 947 948 /** 949 * Gets the Java constant name of the dependency. 950 * 951 * @return The Java constant name of the dependency. 952 * 953 * @throws ModelObjectException if compiling the name of the dependency to a {@code JavaIdentifier} fails. 954 * 955 * @since 1.4 956 * 957 * @see #getName() 958 */ 959 public JavaIdentifier getJavaConstantName() throws ModelObjectException 960 { 961 try 962 { 963 return JavaIdentifier.normalize( this.getName() != null ? this.getName() : "", 964 JavaIdentifier.NormalizationMode.CONSTANT_NAME_CONVENTION ); 965 966 } 967 catch ( final java.text.ParseException e ) 968 { 969 throw new ModelObjectException( getMessage( "javaIdentifierParseException", this.getName(), 970 getMessage( e ) ), e ); 971 972 } 973 } 974 975 /** 976 * Gets a single {@code JAXBElement} matching a namespace URI and local part from the {@code any} property of the 977 * instance. 978 * 979 * @param namespaceURI The namespace URI of the {@code JAXBElement} to return. 980 * @param localPart The local part of the {@code JAXBElement} to return. 981 * 982 * @return The {@code JAXBElement} matching {@code namespaceURI} and {@code localPart} from the {@code any} property 983 * of the instance or {@code null}, if no such element is found. 984 * 985 * @throws NullPointerException if {@code namespaceURI} or {@code localPart} is {@code null}. 986 * @throws IllegalStateException if the {@code any} property contains more than one matching element. 987 * 988 * @see #getAnyElement(java.util.List, java.lang.String, java.lang.String) 989 * 990 * @deprecated As of JOMC 1.1, please use method {@link #getAnyElement(java.lang.String, java.lang.String, java.lang.Class)}. 991 * This method will be removed in version 2.0. 992 */ 993 @Deprecated 994 public javax.xml.bind.JAXBElement getAnyElement( final String namespaceURI, final String localPart ) 995 { 996 return this.getAnyElement( this.getAny(), namespaceURI, localPart ); 997 } 998 999 /** 1000 * Gets a list containing all {@code JAXBElement}s matching a namespace URI and local part from the {@code any} 1001 * property of the instance. 1002 * 1003 * @param namespaceURI The namespace URI of the {@code JAXBElement}s to return. 1004 * @param localPart The local part of the {@code JAXBElement}s to return. 1005 * 1006 * @return An unmodifiable list of all {@code JAXBElement}s matching {@code namespaceURI} and {@code localPart} from 1007 * the {@code any} property of the instance - an empty list if no such elements are found. 1008 * 1009 * @throws NullPointerException if {@code namespaceURI} or {@code localPart} is {@code null}. 1010 * 1011 * @see #getAnyElements(java.util.List, java.lang.String, java.lang.String) 1012 * 1013 * @deprecated As of JOMC 1.1, please use method {@link #getAnyElements(java.lang.String, java.lang.String, java.lang.Class)}. 1014 * This method will be removed in version 2.0. 1015 */ 1016 @Deprecated 1017 public java.util.List<javax.xml.bind.JAXBElement> getAnyElements( final String namespaceURI, 1018 final String localPart ) 1019 { 1020 return this.getAnyElements( this.getAny(), namespaceURI, localPart ); 1021 } 1022 1023 /** 1024 * Gets a single {@code JAXBElement} matching a namespace URI and local part from the {@code any} property of the 1025 * instance. 1026 * 1027 * @param namespaceURI The namespace URI of the {@code JAXBElement} to return. 1028 * @param localPart The local part of the {@code JAXBElement} to return. 1029 * @param type The class of the type the element is bound to. 1030 * @param <T> The type the element is bound to. 1031 * 1032 * @return The {@code JAXBElement} matching {@code namespaceURI} and {@code localPart} from the {@code any} property 1033 * of the instance or {@code null}, if no such element is found. 1034 * 1035 * @throws NullPointerException if {@code namespaceURI}, {@code localPart} or {@code type} is {@code null}. 1036 * @throws IllegalStateException if the {@code any} property contains more than one matching element. 1037 * 1038 * @see #getAnyElement(java.util.List, java.lang.String, java.lang.String, java.lang.Class) 1039 * 1040 * @since 1.1 1041 */ 1042 public <T> javax.xml.bind.JAXBElement<T> getAnyElement( final String namespaceURI, final String localPart, 1043 final Class<T> type ) 1044 { 1045 return this.getAnyElement( this.getAny(), namespaceURI, localPart, type ); 1046 } 1047 1048 /** 1049 * Gets a list containing all {@code JAXBElement}s matching a namespace URI and local part from the {@code any} 1050 * property of the instance. 1051 * 1052 * @param namespaceURI The namespace URI of the {@code JAXBElement}s to return. 1053 * @param localPart The local part of the {@code JAXBElement}s to return. 1054 * @param type The class of the type the elements are bound to. 1055 * @param <T> The type the elements are bound to. 1056 * 1057 * @return An unmodifiable list of all {@code JAXBElement}s matching {@code namespaceURI} and {@code localPart} from 1058 * the {@code any} property of the instance - an empty list if no such elements are found. 1059 * 1060 * @throws NullPointerException if {@code namespaceURI}, {@code localPart} or {@code type} is {@code null}. 1061 * 1062 * @see #getAnyElements(java.util.List, java.lang.String, java.lang.String, java.lang.Class) 1063 * 1064 * @since 1.1 1065 */ 1066 public <T> java.util.List<javax.xml.bind.JAXBElement<T>> getAnyElements( final String namespaceURI, 1067 final String localPart, 1068 final Class<T> type ) 1069 { 1070 return this.getAnyElements( this.getAny(), namespaceURI, localPart, type ); 1071 } 1072 1073 /** 1074 * Gets a single object matching a given class from the {@code any} property of the instance. 1075 * 1076 * @param clazz The class to return an instance of. 1077 * @param <T> The type of the object to return. 1078 * 1079 * @return The instance of {@code clazz} from the {@code any} property of the instance or {@code null}, if no such 1080 * instance is found. 1081 * 1082 * @throws NullPointerException if {@code clazz} is {@code null}. 1083 * @throws IllegalStateException if the {@code any} property contains more than one matching object. 1084 * 1085 * @see #getAnyObject(java.util.List, java.lang.Class) 1086 */ 1087 public <T> T getAnyObject( final Class<T> clazz ) 1088 { 1089 return this.getAnyObject( this.getAny(), clazz ); 1090 } 1091 1092 /** 1093 * Gets a list containing all objects matching a given class from the {@code any} property of the instance. 1094 * 1095 * @param clazz The class to return all instances of. 1096 * @param <T> The type of the objects to return. 1097 * 1098 * @return An unmodifiable list of all instances of {@code clazz} from the {@code any} property of the instance - 1099 * an empty list if no such objects are found. 1100 * 1101 * @throws NullPointerException if {@code clazz} is {@code null}. 1102 * 1103 * @see #getAnyObjects(java.util.List, java.lang.Class) 1104 */ 1105 public <T> java.util.List<T> getAnyObjects( final Class<T> clazz ) 1106 { 1107 return this.getAnyObjects( this.getAny(), clazz ); 1108 } 1109 1110 private static String getMessage( final Throwable t ) 1111 { 1112 return t != null 1113 ? t.getMessage() != null && t.getMessage().trim().length() > 0 1114 ? t.getMessage() 1115 : getMessage( t.getCause() ) 1116 : null; 1117 1118 } 1119 1120 private static String getMessage( final String key, final Object... arguments ) 1121 { 1122 return java.text.MessageFormat.format( java.util.ResourceBundle.getBundle( 1123 Dependency.class.getName().replace( '.', '/' ), java.util.Locale.getDefault() ). 1124 getString( key ), arguments ); 1125 1126 } 1127 1128}