001 //
002 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
003 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
004 // Any modifications to this file will be lost upon recompilation of the source schema.
005 // Generated on: 2009.10.04 at 12:50:46 AM UTC
006 //
007
008
009 package org.jomc.model.bootstrap;
010
011 import java.util.ArrayList;
012 import java.util.Iterator;
013 import java.util.List;
014 import javax.annotation.Generated;
015 import javax.xml.bind.annotation.XmlAccessType;
016 import javax.xml.bind.annotation.XmlAccessorType;
017 import javax.xml.bind.annotation.XmlType;
018
019
020 /**
021 * List of schemas.
022 * @see Schema
023 *
024 *
025 *
026 */
027 @XmlAccessorType(XmlAccessType.FIELD)
028 @XmlType(name = "Schemas", propOrder = {
029 "schema"
030 })
031 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
032 public class Schemas
033 extends BootstrapObject
034 implements Cloneable
035 {
036
037 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
038 protected List<Schema> schema;
039
040 /**
041 * Creates a new {@code Schemas} instance.
042 *
043 */
044 public Schemas() {
045 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
046 super();
047 }
048
049 /**
050 * Creates a new {@code Schemas} instance by deeply copying a given instance.
051 *
052 * @param o
053 * The instance to copy or {@code null}.
054 */
055 public Schemas(final Schemas o) {
056 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
057 super(o);
058 if (o!= null) {
059 {
060 // 'Schema' collection.
061 copySchema(o.getSchema(), getSchema());
062 }
063 }
064 }
065
066 /**
067 * Gets the value of the schema property.
068 *
069 * <p>
070 * This accessor method returns a reference to the live list,
071 * not a snapshot. Therefore any modification you make to the
072 * returned list will be present inside the JAXB object.
073 * This is why there is not a <CODE>set</CODE> method for the schema property.
074 *
075 * <p>
076 * For example, to add a new item, do as follows:
077 * <pre>
078 * getSchema().add(newItem);
079 * </pre>
080 *
081 *
082 * <p>
083 * Objects of the following type(s) are allowed in the list
084 * {@link Schema }
085 *
086 *
087 */
088 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
089 public List<Schema> getSchema() {
090 if (schema == null) {
091 schema = new ArrayList<Schema>();
092 }
093 return this.schema;
094 }
095
096 /**
097 * Copies all values of property {@code Schema} deeply.
098 *
099 * @param target
100 * The target to copy {@code source} to.
101 * @param source
102 * The source to copy from.
103 * @throws NullPointerException
104 * if {@code source} or {@code target} is {@code null}.
105 */
106 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
107 private static void copySchema(final List<Schema> source, final List<Schema> target) {
108 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
109 if (!source.isEmpty()) {
110 for (Iterator it = source.iterator(); it.hasNext(); ) {
111 final Object next = it.next();
112 if (next instanceof Schema) {
113 // CClassInfo: org.jomc.model.bootstrap.Schema
114 target.add(((Schema) next).clone());
115 continue;
116 }
117 // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
118 throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Schema' of class 'org.jomc.model.bootstrap.Schemas'."));
119 }
120 }
121 }
122
123 /**
124 * Creates and returns a deep copy of this object.
125 *
126 *
127 * @return
128 * A deep copy of this object.
129 */
130 @Override
131 @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-10-04T12:50:46+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
132 public Schemas clone() {
133 // CC-XJC Version 1.0 Build 2009-09-18T15:48:40+0000
134 return new Schemas(this);
135 }
136
137 /**
138 * Gets a schema for a given public id from this list of schemas.
139 *
140 * @param publicId The public id of the schema to return.
141 *
142 * @return The schema with public id {@code publicId} from the list or {@code null}
143 * if no schema matching {@code publicId} is found.
144 *
145 * @throws NullPointerException if {@code publicId} is {@code null}.
146 */
147 public Schema getSchema( final String publicId )
148 {
149 if ( publicId == null )
150 {
151 throw new NullPointerException( "publicId" );
152 }
153
154 for ( Schema s : this.getSchema() )
155 {
156 if ( s.getPublicId().equals( publicId ) )
157 {
158 return s;
159 }
160 }
161
162 return null;
163 }
164
165 }