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.12.07 at 03:06:36 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     * 
023     * <p>Java class for Schemas complex type.
024     * 
025     * <p>The following schema fragment specifies the expected content contained within this class.
026     * 
027     * <pre>
028     * &lt;complexType name="Schemas">
029     *   &lt;complexContent>
030     *     &lt;extension base="{http://jomc.org/model/bootstrap}BootstrapObject">
031     *       &lt;sequence>
032     *         &lt;element ref="{http://jomc.org/model/bootstrap}schema" maxOccurs="unbounded" minOccurs="0"/>
033     *       &lt;/sequence>
034     *     &lt;/extension>
035     *   &lt;/complexContent>
036     * &lt;/complexType>
037     * </pre>
038     * 
039     * 
040     */
041    @XmlAccessorType(XmlAccessType.FIELD)
042    @XmlType(name = "Schemas", propOrder = {
043        "schema"
044    })
045    @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
046    public class Schemas
047        extends BootstrapObject
048        implements Cloneable
049    {
050    
051        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
052        protected List<Schema> schema;
053    
054        /**
055         * Creates a new {@code Schemas} instance.
056         * 
057         */
058        public Schemas() {
059            // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
060            super();
061        }
062    
063        /**
064         * Creates a new {@code Schemas} instance by deeply copying a given {@code Schemas} instance.
065         * 
066         * 
067         * @param o
068         *     The instance to copy.
069         * @throws NullPointerException
070         *     if {@code o} is {@code null}.
071         */
072        public Schemas(final Schemas o) {
073            // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
074            super(o);
075            if (o == null) {
076                throw new NullPointerException("Cannot create a copy of 'Schemas' from 'null'.");
077            }
078            // 'Schema' collection.
079            copySchema(o.getSchema(), getSchema());
080        }
081    
082        /**
083         * Gets the value of the schema property.
084         * 
085         * <p>
086         * This accessor method returns a reference to the live list,
087         * not a snapshot. Therefore any modification you make to the
088         * returned list will be present inside the JAXB object.
089         * This is why there is not a <CODE>set</CODE> method for the schema property.
090         * 
091         * <p>
092         * For example, to add a new item, do as follows:
093         * <pre>
094         *    getSchema().add(newItem);
095         * </pre>
096         * 
097         * 
098         * <p>
099         * Objects of the following type(s) are allowed in the list
100         * {@link Schema }
101         * 
102         * 
103         */
104        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
105        public List<Schema> getSchema() {
106            if (schema == null) {
107                schema = new ArrayList<Schema>();
108            }
109            return this.schema;
110        }
111    
112        /**
113         * Copies all values of property {@code Schema} deeply.
114         * 
115         * @param target
116         *     The target to copy {@code source} to.
117         * @param source
118         *     The source to copy from.
119         * @throws NullPointerException
120         *     if {@code source} or {@code target} is {@code null}.
121         */
122        @SuppressWarnings("unchecked")
123        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
124        private static void copySchema(final List<Schema> source, final List<Schema> target) {
125            // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
126            if (!source.isEmpty()) {
127                for (Iterator it = source.iterator(); it.hasNext(); ) {
128                    final Object next = it.next();
129                    if (next instanceof Schema) {
130                        // CClassInfo: org.jomc.model.bootstrap.Schema
131                        target.add(((Schema) next).clone());
132                        continue;
133                    }
134                    // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
135                    throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'Schema' of class 'org.jomc.model.bootstrap.Schemas'."));
136                }
137            }
138        }
139    
140        /**
141         * Creates and returns a deep copy of this object.
142         * 
143         * 
144         * @return
145         *     A deep copy of this object.
146         */
147        @Override
148        @Generated(value = "com.sun.tools.xjc.Driver", date = "2009-12-07T03:06:36+00:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
149        public Schemas clone() {
150            // CC-XJC Version 1.2 Build 2009-11-15T21:50:02+0000
151            return new Schemas(this);
152        }
153        
154        /**
155         * Gets a schema for a given public identifier from this list of schemas.
156         *
157         * @param publicId The public identifier of the schema to return.
158         *
159         * @return The schema with public identifier {@code publicId} from the list or {@code null} if no schema matching
160         * {@code publicId} is found.
161         *
162         * @throws NullPointerException if {@code publicId} is {@code null}.
163         *
164         * @see #getSchema()
165         */
166        public Schema getSchemaByPublicId( final String publicId )
167        {
168            if ( publicId == null )
169            {
170                throw new NullPointerException( "publicId" );
171            }
172    
173            for ( Schema s : this.getSchema() )
174            {
175                if ( publicId.equals( s.getPublicId() ) )
176                {
177                    return s;
178                }
179            }
180    
181            return null;
182        }
183    
184        /**
185         * Gets a schema for a given system identifier from this list of schemas.
186         *
187         * @param systemId The system identifier of the schema to return.
188         *
189         * @return The schema with system identifier {@code systemId} from the list or {@code null} if no schema matching
190         * {@code systemId} is found.
191         *
192         * @throws NullPointerException if {@code systemId} is {@code null}.
193         *
194         * @see #getSchema()
195         */
196        public Schema getSchemaBySystemId( final String systemId )
197        {
198            if ( systemId == null )
199            {
200                throw new NullPointerException( "systemId" );
201            }
202    
203            for ( Schema s : this.getSchema() )
204            {
205                if ( systemId.equals( s.getSystemId() ) )
206                {
207                    return s;
208                }
209            }
210    
211            return null;
212        }
213    
214          
215    }