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: 2012.05.23 at 02:54:23 AM CEST 
006    //
007    
008    
009    package org.jomc.tools.model;
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.XmlAttribute;
018    import javax.xml.bind.annotation.XmlElement;
019    import javax.xml.bind.annotation.XmlType;
020    import org.jomc.model.Inheritable;
021    
022    
023    /**
024     * List of source files.
025     * 
026     * <p>Java class for SourceFilesType complex type.
027     * 
028     * <p>The following schema fragment specifies the expected content contained within this class.
029     * 
030     * <pre>
031     * &lt;complexType name="SourceFilesType">
032     *   &lt;complexContent>
033     *     &lt;extension base="{http://jomc.org/tools/model}ToolsType">
034     *       &lt;sequence>
035     *         &lt;element ref="{http://jomc.org/tools/model}source-file" maxOccurs="unbounded" minOccurs="0"/>
036     *       &lt;/sequence>
037     *       &lt;attribute name="final" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
038     *       &lt;attribute name="override" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
039     *     &lt;/extension>
040     *   &lt;/complexContent>
041     * &lt;/complexType>
042     * </pre>
043     * 
044     * 
045     */
046    @XmlAccessorType(XmlAccessType.FIELD)
047    @XmlType(name = "SourceFilesType", namespace = "http://jomc.org/tools/model", propOrder = {
048        "sourceFile"
049    })
050    @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
051    public class SourceFilesType
052        extends ToolsType
053        implements Cloneable, Inheritable
054    {
055    
056        @XmlElement(name = "source-file", namespace = "http://jomc.org/tools/model")
057        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
058        protected List<SourceFileType> sourceFile;
059        @XmlAttribute(name = "final")
060        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
061        protected Boolean _final;
062        @XmlAttribute(name = "override")
063        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
064        protected Boolean override;
065    
066        /**
067         * Creates a new {@code SourceFilesType} instance.
068         * 
069         */
070        public SourceFilesType() {
071            // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
072            super();
073        }
074    
075        /**
076         * Creates a new {@code SourceFilesType} instance by deeply copying a given {@code SourceFilesType} instance.
077         * 
078         * 
079         * @param o
080         *     The instance to copy.
081         * @throws NullPointerException
082         *     if {@code o} is {@code null}.
083         */
084        public SourceFilesType(final SourceFilesType o) {
085            // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
086            super(o);
087            if (o == null) {
088                throw new NullPointerException("Cannot create a copy of 'SourceFilesType' from 'null'.");
089            }
090            // 'SourceFile' collection.
091            if (o.sourceFile!= null) {
092                copySourceFile(o.getSourceFile(), this.getSourceFile());
093            }
094            // CBuiltinLeafInfo: java.lang.Boolean
095            this._final = ((o._final == null)?null:o.isFinal());
096            // CBuiltinLeafInfo: java.lang.Boolean
097            this.override = ((o.override == null)?null:o.isOverride());
098        }
099    
100        /**
101         * Gets the value of the sourceFile property.
102         * 
103         * <p>
104         * This accessor method returns a reference to the live list,
105         * not a snapshot. Therefore any modification you make to the
106         * returned list will be present inside the JAXB object.
107         * This is why there is not a <CODE>set</CODE> method for the sourceFile property.
108         * 
109         * <p>
110         * For example, to add a new item, do as follows:
111         * <pre>
112         *    getSourceFile().add(newItem);
113         * </pre>
114         * 
115         * 
116         * <p>
117         * Objects of the following type(s) are allowed in the list
118         * {@link SourceFileType }
119         * 
120         * 
121         */
122        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
123        public List<SourceFileType> getSourceFile() {
124            if (sourceFile == null) {
125                sourceFile = new ArrayList<SourceFileType>();
126            }
127            return this.sourceFile;
128        }
129    
130        /**
131         * Gets the value of the final property.
132         * 
133         * @return
134         *     possible object is
135         *     {@link Boolean }
136         *     
137         */
138        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
139        public boolean isFinal() {
140            if (_final == null) {
141                return false;
142            } else {
143                return _final;
144            }
145        }
146    
147        /**
148         * Sets the value of the final property.
149         * 
150         * @param value
151         *     allowed object is
152         *     {@link Boolean }
153         *     
154         */
155        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
156        public void setFinal(Boolean value) {
157            this._final = value;
158        }
159    
160        /**
161         * Gets the value of the override property.
162         * 
163         * @return
164         *     possible object is
165         *     {@link Boolean }
166         *     
167         */
168        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
169        public boolean isOverride() {
170            if (override == null) {
171                return false;
172            } else {
173                return override;
174            }
175        }
176    
177        /**
178         * Sets the value of the override property.
179         * 
180         * @param value
181         *     allowed object is
182         *     {@link Boolean }
183         *     
184         */
185        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
186        public void setOverride(Boolean value) {
187            this.override = value;
188        }
189    
190        /**
191         * Copies all values of property {@code SourceFile} deeply.
192         * 
193         * @param source
194         *     The source to copy from.
195         * @param target
196         *     The target to copy {@code source} to.
197         * @throws NullPointerException
198         *     if {@code target} is {@code null}.
199         */
200        @SuppressWarnings("unchecked")
201        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
202        private static void copySourceFile(final List<SourceFileType> source, final List<SourceFileType> target) {
203            // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
204            if ((source!= null)&&(!source.isEmpty())) {
205                for (final Iterator<?> it = source.iterator(); it.hasNext(); ) {
206                    final Object next = it.next();
207                    if (next instanceof SourceFileType) {
208                        // CClassInfo: org.jomc.tools.model.SourceFileType
209                        target.add(((SourceFileType) next).clone());
210                        continue;
211                    }
212                    // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
213                    throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'SourceFile' of class 'org.jomc.tools.model.SourceFilesType'."));
214                }
215            }
216        }
217    
218        /**
219         * Creates and returns a deep copy of this object.
220         * 
221         * 
222         * @return
223         *     A deep copy of this object.
224         */
225        @Override
226        @Generated(value = "com.sun.tools.xjc.Driver", date = "2012-05-23T02:54:23+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
227        public SourceFilesType clone() {
228            {
229                // CC-XJC Version 2.0 Build 2011-09-16T18:27:24+0000
230                final SourceFilesType clone = ((SourceFilesType) super.clone());
231                // 'SourceFile' collection.
232                if (this.sourceFile!= null) {
233                    clone.sourceFile = null;
234                    copySourceFile(this.getSourceFile(), clone.getSourceFile());
235                }
236                // CBuiltinLeafInfo: java.lang.Boolean
237                clone._final = ((this._final == null)?null:this.isFinal());
238                // CBuiltinLeafInfo: java.lang.Boolean
239                clone.override = ((this.override == null)?null:this.isOverride());
240                return clone;
241            }
242        }
243        
244        /**
245         * Gets a source file model for a given name from the list of source file models.
246         *
247         * @param identifier The identifier of the source file model to return.
248         *
249         * @return The first matching source file model or {@code null}, if no such source file model is found.
250         *
251         * @throws NullPointerException if {@code identifier} is {@code null}.
252         *
253         * @see #getSourceFile()
254         * @see SourceFileType#getIdentifier()
255         */
256        public SourceFileType getSourceFile( final String identifier )
257        {
258            if ( identifier == null )
259            {
260                throw new NullPointerException( "identifier" );
261            }
262    
263            for ( int i = 0, s0 = this.getSourceFile().size(); i < s0; i++ )
264            {
265                final SourceFileType s = this.getSourceFile().get( i );
266    
267                if ( identifier.equals( s.getIdentifier() ) )
268                {
269                    return s;
270                }
271            }
272    
273            return null;
274        }
275          
276    }