001 // =================== DO NOT EDIT THIS FILE ====================
002 // Generated by Modello 1.7,
003 // any modifications will be overwritten.
004 // ==============================================================
005
006 package org.apache.maven.model;
007
008 /**
009 *
010 *
011 * The <code><parent></code> element contains
012 * information required to locate the parent project from which
013 * this project will inherit from.
014 * <strong>Note:</strong> The children of this element are
015 * not interpolated and must be given as literal values.
016 *
017 *
018 *
019 * @version $Revision$ $Date$
020 */
021 @SuppressWarnings( "all" )
022 public class Parent
023 implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
024 {
025
026 //--------------------------/
027 //- Class/Member Variables -/
028 //--------------------------/
029
030 /**
031 * The group id of the parent project to inherit from.
032 */
033 private String groupId;
034
035 /**
036 * The artifact id of the parent project to inherit from.
037 */
038 private String artifactId;
039
040 /**
041 * The version of the parent project to inherit.
042 */
043 private String version;
044
045 /**
046 *
047 *
048 * The relative path of the parent
049 * <code>pom.xml</code> file within the check out.
050 * If not specified, it defaults to
051 * <code>../pom.xml</code>.
052 * Maven looks for the parent POM first in this
053 * location on
054 * the filesystem, then the local repository, and
055 * lastly in the remote repo.
056 * <code>relativePath</code> allows you to select a
057 * different location,
058 * for example when your structure is flat, or
059 * deeper without an intermediate parent POM.
060 * However, the group ID, artifact ID and version
061 * are still required,
062 * and must match the file in the location given or
063 * it will revert to the repository for the POM.
064 * This feature is only for enhancing the
065 * development in a local checkout of that project.
066 * Set the value to an empty string in case you
067 * want to disable the feature and always resolve
068 * the parent POM from the repositories.
069 *
070 *
071 */
072 private String relativePath = "../pom.xml";
073
074 /**
075 * Field locations.
076 */
077 private java.util.Map<Object, InputLocation> locations;
078
079
080 //-----------/
081 //- Methods -/
082 //-----------/
083
084 /**
085 * Method clone.
086 *
087 * @return Parent
088 */
089 public Parent clone()
090 {
091 try
092 {
093 Parent copy = (Parent) super.clone();
094
095 if ( copy.locations != null )
096 {
097 copy.locations = new java.util.LinkedHashMap( copy.locations );
098 }
099
100 return copy;
101 }
102 catch ( java.lang.Exception ex )
103 {
104 throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
105 + " does not support clone()" ).initCause( ex );
106 }
107 } //-- Parent clone()
108
109 /**
110 * Get the artifact id of the parent project to inherit from.
111 *
112 * @return String
113 */
114 public String getArtifactId()
115 {
116 return this.artifactId;
117 } //-- String getArtifactId()
118
119 /**
120 * Get the group id of the parent project to inherit from.
121 *
122 * @return String
123 */
124 public String getGroupId()
125 {
126 return this.groupId;
127 } //-- String getGroupId()
128
129 /**
130 *
131 *
132 * @param key
133 * @return InputLocation
134 */
135 public InputLocation getLocation( Object key )
136 {
137 return ( locations != null ) ? locations.get( key ) : null;
138 } //-- InputLocation getLocation( Object )
139
140 /**
141 * Get the relative path of the parent <code>pom.xml</code>
142 * file within the check out.
143 * If not specified, it defaults to
144 * <code>../pom.xml</code>.
145 * Maven looks for the parent POM first in this
146 * location on
147 * the filesystem, then the local repository, and
148 * lastly in the remote repo.
149 * <code>relativePath</code> allows you to select a
150 * different location,
151 * for example when your structure is flat, or
152 * deeper without an intermediate parent POM.
153 * However, the group ID, artifact ID and version
154 * are still required,
155 * and must match the file in the location given or
156 * it will revert to the repository for the POM.
157 * This feature is only for enhancing the
158 * development in a local checkout of that project.
159 * Set the value to an empty string in case you
160 * want to disable the feature and always resolve
161 * the parent POM from the repositories.
162 *
163 * @return String
164 */
165 public String getRelativePath()
166 {
167 return this.relativePath;
168 } //-- String getRelativePath()
169
170 /**
171 * Get the version of the parent project to inherit.
172 *
173 * @return String
174 */
175 public String getVersion()
176 {
177 return this.version;
178 } //-- String getVersion()
179
180 /**
181 * Set the artifact id of the parent project to inherit from.
182 *
183 * @param artifactId
184 */
185 public void setArtifactId( String artifactId )
186 {
187 this.artifactId = artifactId;
188 } //-- void setArtifactId( String )
189
190 /**
191 * Set the group id of the parent project to inherit from.
192 *
193 * @param groupId
194 */
195 public void setGroupId( String groupId )
196 {
197 this.groupId = groupId;
198 } //-- void setGroupId( String )
199
200 /**
201 *
202 *
203 * @param key
204 * @param location
205 */
206 public void setLocation( Object key, InputLocation location )
207 {
208 if ( location != null )
209 {
210 if ( this.locations == null )
211 {
212 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
213 }
214 this.locations.put( key, location );
215 }
216 } //-- void setLocation( Object, InputLocation )
217
218 /**
219 * Set the relative path of the parent <code>pom.xml</code>
220 * file within the check out.
221 * If not specified, it defaults to
222 * <code>../pom.xml</code>.
223 * Maven looks for the parent POM first in this
224 * location on
225 * the filesystem, then the local repository, and
226 * lastly in the remote repo.
227 * <code>relativePath</code> allows you to select a
228 * different location,
229 * for example when your structure is flat, or
230 * deeper without an intermediate parent POM.
231 * However, the group ID, artifact ID and version
232 * are still required,
233 * and must match the file in the location given or
234 * it will revert to the repository for the POM.
235 * This feature is only for enhancing the
236 * development in a local checkout of that project.
237 * Set the value to an empty string in case you
238 * want to disable the feature and always resolve
239 * the parent POM from the repositories.
240 *
241 * @param relativePath
242 */
243 public void setRelativePath( String relativePath )
244 {
245 this.relativePath = relativePath;
246 } //-- void setRelativePath( String )
247
248 /**
249 * Set the version of the parent project to inherit.
250 *
251 * @param version
252 */
253 public void setVersion( String version )
254 {
255 this.version = version;
256 } //-- void setVersion( String )
257
258
259
260 /**
261 * @return the id as <code>groupId:artifactId:version</code>
262 */
263 public String getId()
264 {
265 StringBuilder id = new StringBuilder( 64 );
266
267 id.append( getGroupId() );
268 id.append( ":" );
269 id.append( getArtifactId() );
270 id.append( ":" );
271 id.append( "pom" );
272 id.append( ":" );
273 id.append( getVersion() );
274
275 return id.toString();
276 }
277
278 @Override
279 public String toString()
280 {
281 return getId();
282 }
283
284
285 }