Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
Archetype |
|
| 1.35;1,35 |
1 | /* | |
2 | =================== DO NOT EDIT THIS FILE ==================== | |
3 | Generated by Modello 1.4.1 on 2011-08-31 21:33:57, | |
4 | any modifications will be overwritten. | |
5 | ============================================================== | |
6 | */ | |
7 | ||
8 | package org.apache.maven.archetype.catalog; | |
9 | ||
10 | /** | |
11 | * Informations to point to an Archetype referenced in the catalog. | |
12 | * | |
13 | * @version $Revision$ $Date$ | |
14 | */ | |
15 | @SuppressWarnings( "all" ) | |
16 | 0 | public class Archetype |
17 | implements java.io.Serializable | |
18 | { | |
19 | ||
20 | //--------------------------/ | |
21 | //- Class/Member Variables -/ | |
22 | //--------------------------/ | |
23 | ||
24 | /** | |
25 | * The groupId of the archetype. | |
26 | */ | |
27 | private String groupId; | |
28 | ||
29 | /** | |
30 | * The artifactId of the archetype. | |
31 | */ | |
32 | private String artifactId; | |
33 | ||
34 | /** | |
35 | * The version of the archetype. <code>RELEASE</code> is a | |
36 | * valid version. | |
37 | */ | |
38 | private String version; | |
39 | ||
40 | /** | |
41 | * The repository where to find the archetype. | |
42 | * When omitted, the archetype is searched for in | |
43 | * the repository where the catalog comes from. | |
44 | */ | |
45 | private String repository; | |
46 | ||
47 | /** | |
48 | * The description of the archetype. | |
49 | */ | |
50 | private String description; | |
51 | ||
52 | /** | |
53 | * Field goals. | |
54 | */ | |
55 | private java.util.List<String> goals; | |
56 | ||
57 | /** | |
58 | * Field properties. | |
59 | */ | |
60 | private java.util.Properties properties; | |
61 | ||
62 | ||
63 | //-----------/ | |
64 | //- Methods -/ | |
65 | //-----------/ | |
66 | ||
67 | /** | |
68 | * Method addGoal. | |
69 | * | |
70 | * @param string | |
71 | */ | |
72 | public void addGoal( String string ) | |
73 | { | |
74 | 0 | getGoals().add( string ); |
75 | 0 | } //-- void addGoal( String ) |
76 | ||
77 | /** | |
78 | * Method addProperty. | |
79 | * | |
80 | * @param key | |
81 | * @param value | |
82 | */ | |
83 | public void addProperty( String key, String value ) | |
84 | { | |
85 | 0 | getProperties().put( key, value ); |
86 | 0 | } //-- void addProperty( String, String ) |
87 | ||
88 | /** | |
89 | * Get the artifactId of the archetype. | |
90 | * | |
91 | * @return String | |
92 | */ | |
93 | public String getArtifactId() | |
94 | { | |
95 | 0 | return this.artifactId; |
96 | } //-- String getArtifactId() | |
97 | ||
98 | /** | |
99 | * Get the description of the archetype. | |
100 | * | |
101 | * @return String | |
102 | */ | |
103 | public String getDescription() | |
104 | { | |
105 | 0 | return this.description; |
106 | } //-- String getDescription() | |
107 | ||
108 | /** | |
109 | * Method getGoals. | |
110 | * | |
111 | * @return List | |
112 | */ | |
113 | public java.util.List<String> getGoals() | |
114 | { | |
115 | 0 | if ( this.goals == null ) |
116 | { | |
117 | 0 | this.goals = new java.util.ArrayList<String>(); |
118 | } | |
119 | ||
120 | 0 | return this.goals; |
121 | } //-- java.util.List<String> getGoals() | |
122 | ||
123 | /** | |
124 | * Get the groupId of the archetype. | |
125 | * | |
126 | * @return String | |
127 | */ | |
128 | public String getGroupId() | |
129 | { | |
130 | 0 | return this.groupId; |
131 | } //-- String getGroupId() | |
132 | ||
133 | /** | |
134 | * Method getProperties. | |
135 | * | |
136 | * @return Properties | |
137 | */ | |
138 | public java.util.Properties getProperties() | |
139 | { | |
140 | 0 | if ( this.properties == null ) |
141 | { | |
142 | 0 | this.properties = new java.util.Properties(); |
143 | } | |
144 | ||
145 | 0 | return this.properties; |
146 | } //-- java.util.Properties getProperties() | |
147 | ||
148 | /** | |
149 | * Get the repository where to find the archetype. | |
150 | * When omitted, the archetype is searched for in | |
151 | * the repository where the catalog comes from. | |
152 | * | |
153 | * @return String | |
154 | */ | |
155 | public String getRepository() | |
156 | { | |
157 | 0 | return this.repository; |
158 | } //-- String getRepository() | |
159 | ||
160 | /** | |
161 | * Get the version of the archetype. <code>RELEASE</code> is a | |
162 | * valid version. | |
163 | * | |
164 | * @return String | |
165 | */ | |
166 | public String getVersion() | |
167 | { | |
168 | 0 | return this.version; |
169 | } //-- String getVersion() | |
170 | ||
171 | /** | |
172 | * Method removeGoal. | |
173 | * | |
174 | * @param string | |
175 | */ | |
176 | public void removeGoal( String string ) | |
177 | { | |
178 | 0 | getGoals().remove( string ); |
179 | 0 | } //-- void removeGoal( String ) |
180 | ||
181 | /** | |
182 | * Set the artifactId of the archetype. | |
183 | * | |
184 | * @param artifactId | |
185 | */ | |
186 | public void setArtifactId( String artifactId ) | |
187 | { | |
188 | 0 | this.artifactId = artifactId; |
189 | 0 | } //-- void setArtifactId( String ) |
190 | ||
191 | /** | |
192 | * Set the description of the archetype. | |
193 | * | |
194 | * @param description | |
195 | */ | |
196 | public void setDescription( String description ) | |
197 | { | |
198 | 0 | this.description = description; |
199 | 0 | } //-- void setDescription( String ) |
200 | ||
201 | /** | |
202 | * Set goals to execute after the creation of the project. | |
203 | * | |
204 | * @param goals | |
205 | */ | |
206 | public void setGoals( java.util.List<String> goals ) | |
207 | { | |
208 | 0 | this.goals = goals; |
209 | 0 | } //-- void setGoals( java.util.List ) |
210 | ||
211 | /** | |
212 | * Set the groupId of the archetype. | |
213 | * | |
214 | * @param groupId | |
215 | */ | |
216 | public void setGroupId( String groupId ) | |
217 | { | |
218 | 0 | this.groupId = groupId; |
219 | 0 | } //-- void setGroupId( String ) |
220 | ||
221 | /** | |
222 | * Set properties that will be used during the execution of | |
223 | * addition goals after the creation of the project. | |
224 | * | |
225 | * @param properties | |
226 | */ | |
227 | public void setProperties( java.util.Properties properties ) | |
228 | { | |
229 | 0 | this.properties = properties; |
230 | 0 | } //-- void setProperties( java.util.Properties ) |
231 | ||
232 | /** | |
233 | * Set the repository where to find the archetype. | |
234 | * When omitted, the archetype is searched for in | |
235 | * the repository where the catalog comes from. | |
236 | * | |
237 | * @param repository | |
238 | */ | |
239 | public void setRepository( String repository ) | |
240 | { | |
241 | 0 | this.repository = repository; |
242 | 0 | } //-- void setRepository( String ) |
243 | ||
244 | /** | |
245 | * Set the version of the archetype. <code>RELEASE</code> is a | |
246 | * valid version. | |
247 | * | |
248 | * @param version | |
249 | */ | |
250 | public void setVersion( String version ) | |
251 | { | |
252 | 0 | this.version = version; |
253 | 0 | } //-- void setVersion( String ) |
254 | ||
255 | ||
256 | public String toString() | |
257 | { | |
258 | 0 | return "[" + groupId + ":" + artifactId + ":" + version + ( repository != null ? " -> " + repository : "" ) + "]"; |
259 | } | |
260 | public int hashCode() | |
261 | { | |
262 | 0 | return groupId.hashCode() + 17 * artifactId.hashCode(); |
263 | } | |
264 | public boolean equals( Object object ) | |
265 | { | |
266 | 0 | if ( object == null || !( object instanceof Archetype ) ) |
267 | { | |
268 | 0 | return false; |
269 | } | |
270 | else | |
271 | { | |
272 | 0 | Archetype a = (Archetype) object; |
273 | 0 | return org.codehaus.plexus.util.StringUtils.equals( groupId, a.getGroupId() ) |
274 | && org.codehaus.plexus.util.StringUtils.equals( artifactId, a.getArtifactId() ); | |
275 | } | |
276 | } | |
277 | ||
278 | } |