Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
FileSet |
|
| 0.0;0 |
1 | /* | |
2 | =================== DO NOT EDIT THIS FILE ==================== | |
3 | Generated by Modello 1.4 on 2010-10-28 03:23:59, | |
4 | any modifications will be overwritten. | |
5 | ============================================================== | |
6 | */ | |
7 | ||
8 | package org.apache.maven.archetype.metadata; | |
9 | ||
10 | /** | |
11 | * A fileset defines the way the project's files located in the jar | |
12 | * file are used by the Archetype Plugin to generate a project. | |
13 | * | |
14 | * @version $Revision$ $Date$ | |
15 | */ | |
16 | @SuppressWarnings( "all" ) | |
17 | 168 | public class FileSet |
18 | implements java.io.Serializable | |
19 | { | |
20 | ||
21 | //--------------------------/ | |
22 | //- Class/Member Variables -/ | |
23 | //--------------------------/ | |
24 | ||
25 | /** | |
26 | * Filesets can be filtered, which means the selected files | |
27 | * will be used as Velocity templates. | |
28 | * They can be non-filtered, which means the selected | |
29 | * files will be copied without modification. | |
30 | */ | |
31 | 168 | private boolean filtered = false; |
32 | ||
33 | /** | |
34 | * Filesets can be packaged, which means the selected files | |
35 | * will be generated/copied in a directory | |
36 | * structure that is prepended by the package | |
37 | * property. They can be non-packaged, which means that the | |
38 | * selected | |
39 | * files will be generated/copied without that | |
40 | * prepend. | |
41 | */ | |
42 | 168 | private boolean packaged = false; |
43 | ||
44 | /** | |
45 | * Encoding to use when filtering content. | |
46 | */ | |
47 | private String encoding; | |
48 | ||
49 | /** | |
50 | * The directory where the files will be searched for, which is | |
51 | * also the directory where the | |
52 | * project's files will be generated. | |
53 | */ | |
54 | private String directory; | |
55 | ||
56 | /** | |
57 | * Field includes. | |
58 | */ | |
59 | private java.util.List<String> includes; | |
60 | ||
61 | /** | |
62 | * Field excludes. | |
63 | */ | |
64 | private java.util.List<String> excludes; | |
65 | ||
66 | ||
67 | //-----------/ | |
68 | //- Methods -/ | |
69 | //-----------/ | |
70 | ||
71 | /** | |
72 | * Method addExclude. | |
73 | * | |
74 | * @param string | |
75 | */ | |
76 | public void addExclude( String string ) | |
77 | { | |
78 | 0 | getExcludes().add( string ); |
79 | 0 | } //-- void addExclude( String ) |
80 | ||
81 | /** | |
82 | * Method addInclude. | |
83 | * | |
84 | * @param string | |
85 | */ | |
86 | public void addInclude( String string ) | |
87 | { | |
88 | 1 | getIncludes().add( string ); |
89 | 1 | } //-- void addInclude( String ) |
90 | ||
91 | /** | |
92 | * Get the directory where the files will be searched for, | |
93 | * which is also the directory where the | |
94 | * project's files will be generated. | |
95 | * | |
96 | * @return String | |
97 | */ | |
98 | public String getDirectory() | |
99 | { | |
100 | 626 | return this.directory; |
101 | } //-- String getDirectory() | |
102 | ||
103 | /** | |
104 | * Get encoding to use when filtering content. | |
105 | * | |
106 | * @return String | |
107 | */ | |
108 | public String getEncoding() | |
109 | { | |
110 | 143 | return this.encoding; |
111 | } //-- String getEncoding() | |
112 | ||
113 | /** | |
114 | * Method getExcludes. | |
115 | * | |
116 | * @return List | |
117 | */ | |
118 | public java.util.List<String> getExcludes() | |
119 | { | |
120 | 446 | if ( this.excludes == null ) |
121 | { | |
122 | 71 | this.excludes = new java.util.ArrayList<String>(); |
123 | } | |
124 | ||
125 | 446 | return this.excludes; |
126 | } //-- java.util.List<String> getExcludes() | |
127 | ||
128 | /** | |
129 | * Method getIncludes. | |
130 | * | |
131 | * @return List | |
132 | */ | |
133 | public java.util.List<String> getIncludes() | |
134 | { | |
135 | 487 | if ( this.includes == null ) |
136 | { | |
137 | 1 | this.includes = new java.util.ArrayList<String>(); |
138 | } | |
139 | ||
140 | 487 | return this.includes; |
141 | } //-- java.util.List<String> getIncludes() | |
142 | ||
143 | /** | |
144 | * Get filesets can be filtered, which means the selected files | |
145 | * will be used as Velocity templates. | |
146 | * They can be non-filtered, which means the selected | |
147 | * files will be copied without modification. | |
148 | * | |
149 | * @return boolean | |
150 | */ | |
151 | public boolean isFiltered() | |
152 | { | |
153 | 388 | return this.filtered; |
154 | } //-- boolean isFiltered() | |
155 | ||
156 | /** | |
157 | * Get filesets can be packaged, which means the selected files | |
158 | * will be generated/copied in a directory | |
159 | * structure that is prepended by the package | |
160 | * property. They can be non-packaged, which means that the | |
161 | * selected | |
162 | * files will be generated/copied without that | |
163 | * prepend. | |
164 | * | |
165 | * @return boolean | |
166 | */ | |
167 | public boolean isPackaged() | |
168 | { | |
169 | 442 | return this.packaged; |
170 | } //-- boolean isPackaged() | |
171 | ||
172 | /** | |
173 | * Method removeExclude. | |
174 | * | |
175 | * @param string | |
176 | */ | |
177 | public void removeExclude( String string ) | |
178 | { | |
179 | 0 | getExcludes().remove( string ); |
180 | 0 | } //-- void removeExclude( String ) |
181 | ||
182 | /** | |
183 | * Method removeInclude. | |
184 | * | |
185 | * @param string | |
186 | */ | |
187 | public void removeInclude( String string ) | |
188 | { | |
189 | 0 | getIncludes().remove( string ); |
190 | 0 | } //-- void removeInclude( String ) |
191 | ||
192 | /** | |
193 | * Set the directory where the files will be searched for, | |
194 | * which is also the directory where the | |
195 | * project's files will be generated. | |
196 | * | |
197 | * @param directory | |
198 | */ | |
199 | public void setDirectory( String directory ) | |
200 | { | |
201 | 168 | this.directory = directory; |
202 | 168 | } //-- void setDirectory( String ) |
203 | ||
204 | /** | |
205 | * Set encoding to use when filtering content. | |
206 | * | |
207 | * @param encoding | |
208 | */ | |
209 | public void setEncoding( String encoding ) | |
210 | { | |
211 | 94 | this.encoding = encoding; |
212 | 94 | } //-- void setEncoding( String ) |
213 | ||
214 | /** | |
215 | * Set exclusion definition "à la" Ant. | |
216 | * | |
217 | * @param excludes | |
218 | */ | |
219 | public void setExcludes( java.util.List<String> excludes ) | |
220 | { | |
221 | 43 | this.excludes = excludes; |
222 | 43 | } //-- void setExcludes( java.util.List ) |
223 | ||
224 | /** | |
225 | * Set filesets can be filtered, which means the selected files | |
226 | * will be used as Velocity templates. | |
227 | * They can be non-filtered, which means the selected | |
228 | * files will be copied without modification. | |
229 | * | |
230 | * @param filtered | |
231 | */ | |
232 | public void setFiltered( boolean filtered ) | |
233 | { | |
234 | 154 | this.filtered = filtered; |
235 | 154 | } //-- void setFiltered( boolean ) |
236 | ||
237 | /** | |
238 | * Set inclusion definition "à la" Ant. | |
239 | * | |
240 | * @param includes | |
241 | */ | |
242 | public void setIncludes( java.util.List<String> includes ) | |
243 | { | |
244 | 167 | this.includes = includes; |
245 | 167 | } //-- void setIncludes( java.util.List ) |
246 | ||
247 | /** | |
248 | * Set filesets can be packaged, which means the selected files | |
249 | * will be generated/copied in a directory | |
250 | * structure that is prepended by the package | |
251 | * property. They can be non-packaged, which means that the | |
252 | * selected | |
253 | * files will be generated/copied without that | |
254 | * prepend. | |
255 | * | |
256 | * @param packaged | |
257 | */ | |
258 | public void setPackaged( boolean packaged ) | |
259 | { | |
260 | 133 | this.packaged = packaged; |
261 | 133 | } //-- void setPackaged( boolean ) |
262 | ||
263 | ||
264 | public String toString() | |
265 | { | |
266 | 200 | return |
267 | getDirectory() + " (" | |
268 | + ( isFiltered() ? "Filtered" : "Copied" ) | |
269 | + "-" | |
270 | + ( isPackaged() ? "Packaged" : "Flat" ) | |
271 | + ") [" | |
272 | + org.codehaus.plexus.util.StringUtils.join( getIncludes().iterator(), ", " ) | |
273 | + " -- " | |
274 | + org.codehaus.plexus.util.StringUtils.join( getExcludes().iterator(), ", " ) | |
275 | + "]"; | |
276 | ||
277 | } | |
278 | ||
279 | } |