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: 2010.06.29 at 01:09:34 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.XmlElement;
018 import javax.xml.bind.annotation.XmlType;
019
020
021 /**
022 * List of source files.
023 *
024 * <p>Java class for SourceFilesType complex type.
025 *
026 * <p>The following schema fragment specifies the expected content contained within this class.
027 *
028 * <pre>
029 * <complexType name="SourceFilesType">
030 * <complexContent>
031 * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
032 * <sequence>
033 * <element ref="{http://jomc.org/tools/model}source-file" maxOccurs="unbounded" minOccurs="0"/>
034 * </sequence>
035 * </restriction>
036 * </complexContent>
037 * </complexType>
038 * </pre>
039 *
040 *
041 */
042 @XmlAccessorType(XmlAccessType.FIELD)
043 @XmlType(name = "SourceFilesType", propOrder = {
044 "sourceFile"
045 })
046 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T01:09:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
047 public class SourceFilesType implements Cloneable
048 {
049
050 @XmlElement(name = "source-file")
051 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T01:09:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
052 protected List<SourceFileType> sourceFile;
053
054 /**
055 * Creates a new {@code SourceFilesType} instance.
056 *
057 */
058 public SourceFilesType() {
059 // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000
060 super();
061 }
062
063 /**
064 * Creates a new {@code SourceFilesType} instance by deeply copying a given {@code SourceFilesType} instance.
065 *
066 *
067 * @param o
068 * The instance to copy.
069 * @throws NullPointerException
070 * if {@code o} is {@code null}.
071 */
072 public SourceFilesType(final SourceFilesType o) {
073 // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000
074 super();
075 if (o == null) {
076 throw new NullPointerException("Cannot create a copy of 'SourceFilesType' from 'null'.");
077 }
078 // 'SourceFile' collection.
079 copySourceFile(o.getSourceFile(), getSourceFile());
080 }
081
082 /**
083 * Gets the value of the sourceFile 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 sourceFile property.
090 *
091 * <p>
092 * For example, to add a new item, do as follows:
093 * <pre>
094 * getSourceFile().add(newItem);
095 * </pre>
096 *
097 *
098 * <p>
099 * Objects of the following type(s) are allowed in the list
100 * {@link SourceFileType }
101 *
102 *
103 */
104 @Generated(value = "com.sun.tools.xjc.Driver", date = "2010-06-29T01:09:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
105 public List<SourceFileType> getSourceFile() {
106 if (sourceFile == null) {
107 sourceFile = new ArrayList<SourceFileType>();
108 }
109 return this.sourceFile;
110 }
111
112 /**
113 * Copies all values of property {@code SourceFile} 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 = "2010-06-29T01:09:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
124 private static void copySourceFile(final List<SourceFileType> source, final List<SourceFileType> target) {
125 // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000
126 if (!source.isEmpty()) {
127 for (Iterator it = source.iterator(); it.hasNext(); ) {
128 final Object next = it.next();
129 if (next instanceof SourceFileType) {
130 // CClassInfo: org.jomc.tools.model.SourceFileType
131 target.add(((SourceFileType) 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 'SourceFile' of class 'org.jomc.tools.model.SourceFilesType'."));
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 = "2010-06-29T01:09:34+02:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-833")
149 public SourceFilesType clone() {
150 // CC-XJC Version 1.3 Build 2010-02-27T15:04:03+0000
151 return new SourceFilesType(this);
152 }
153
154 /**
155 * Gets a source file model for a given name from the list.
156 *
157 * @param identifier The identifier of the source file model to return.
158 *
159 * @return The source file model matching {@code identifier} from the list or {@code null} if no such source file
160 * model is found.
161 *
162 * @throws NullPointerException if {@code identifier} is {@code null}.
163 */
164 public SourceFileType getSourceFile( final String identifier )
165 {
166 if ( identifier == null )
167 {
168 throw new NullPointerException( "identifier" );
169 }
170
171 for ( SourceFileType s : this.getSourceFile() )
172 {
173 if ( identifier.equals( s.getIdentifier() ) )
174 {
175 return s;
176 }
177 }
178
179 return null;
180 }
181
182 }