View Javadoc
1   /*
2    Licensed to the Apache Software Foundation (ASF) under one
3    or more contributor license agreements.  See the NOTICE file
4    distributed with this work for additional information
5    regarding copyright ownership.  The ASF licenses this file
6    to you under the Apache License, Version 2.0 (the
7    "License"); you may not use this file except in compliance
8    with the License.  You may obtain a copy of the License at
9    
10       http://www.apache.org/licenses/LICENSE-2.0
11   
12   Unless required by applicable law or agreed to in writing,
13   software distributed under the License is distributed on an
14   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   KIND, either express or implied.  See the License for the
16   specific language governing permissions and limitations
17   under the License.
18   =================== DO NOT EDIT THIS FILE ====================
19   Generated by Modello 2.4.0,
20   any modifications will be overwritten.
21   ==============================================================
22   */
23  
24  package org.apache.maven.archetype.metadata;
25  
26  /**
27   * 
28   *         A fileset defines the way the project's files located in
29   * the jar file are used by the Archetype Plugin to generate a
30   * project.
31   *         If file or directory name contains
32   * <code>__<i>property</i>__</code> pattern, it is replaced with
33   * corresponding property value.
34   *         
35   * 
36   * @version $Revision$ $Date$
37   */
38  @SuppressWarnings( "all" )
39  public class FileSet
40      implements java.io.Serializable
41  {
42  
43        //--------------------------/
44       //- Class/Member Variables -/
45      //--------------------------/
46  
47      /**
48       * 
49       *             Filesets can be filtered, which means the
50       * selected files will be used as
51       *             <a
52       * href="https://velocity.apache.org/engine/1.5/user-guide.html">Velocity
53       * templates</a>.
54       *             They can be non-filtered, which means the
55       * selected files will be copied without modification.
56       *           
57       */
58      private boolean filtered = false;
59  
60      /**
61       * Filesets can be packaged, which means the selected files
62       * will be generated/copied in a directory
63       *            structure that is prepended by the package
64       * property. They can be non-packaged, which means that the
65       * selected
66       *            files will be generated/copied without that
67       * prepend.
68       */
69      private boolean packaged = false;
70  
71      /**
72       * Encoding to use when filtering content.
73       */
74      private String encoding;
75  
76      /**
77       * A string value that should resolve to a boolean value to
78       * conditionally include filesets.
79       *           This condition should be either a boolean as
80       * String or a velocity template language statement that
81       * resolves
82       *           to a boolean value. If the descriptor contains
83       * includeCondition="${shouldInclude}" and the archetype has
84       *           a (required) property like shouldInclude=true the
85       * fileset is included.
86       */
87      private String includeCondition;
88  
89      /**
90       * The directory where the files will be searched for, which is
91       * also the directory where the
92       *            project's files will be generated.
93       */
94      private String directory = "";
95  
96      /**
97       * Field includes.
98       */
99      private java.util.List<String> includes;
100 
101     /**
102      * Field excludes.
103      */
104     private java.util.List<String> excludes;
105 
106 
107       //-----------/
108      //- Methods -/
109     //-----------/
110 
111     /**
112      * Method addExclude.
113      * 
114      * @param string a string object.
115      */
116     public void addExclude( String string )
117     {
118         getExcludes().add( string );
119     } //-- void addExclude( String )
120 
121     /**
122      * Method addInclude.
123      * 
124      * @param string a string object.
125      */
126     public void addInclude( String string )
127     {
128         getIncludes().add( string );
129     } //-- void addInclude( String )
130 
131     /**
132      * Get the directory where the files will be searched for,
133      * which is also the directory where the
134      *            project's files will be generated.
135      * 
136      * @return String
137      */
138     public String getDirectory()
139     {
140         return this.directory;
141     } //-- String getDirectory()
142 
143     /**
144      * Get encoding to use when filtering content.
145      * 
146      * @return String
147      */
148     public String getEncoding()
149     {
150         return this.encoding;
151     } //-- String getEncoding()
152 
153     /**
154      * Method getExcludes.
155      * 
156      * @return List
157      */
158     public java.util.List<String> getExcludes()
159     {
160         if ( this.excludes == null )
161         {
162             this.excludes = new java.util.ArrayList<String>();
163         }
164 
165         return this.excludes;
166     } //-- java.util.List<String> getExcludes()
167 
168     /**
169      * Get a string value that should resolve to a boolean value to
170      * conditionally include filesets.
171      *           This condition should be either a boolean as
172      * String or a velocity template language statement that
173      * resolves
174      *           to a boolean value. If the descriptor contains
175      * includeCondition="${shouldInclude}" and the archetype has
176      *           a (required) property like shouldInclude=true the
177      * fileset is included.
178      * 
179      * @return String
180      */
181     public String getIncludeCondition()
182     {
183         return this.includeCondition;
184     } //-- String getIncludeCondition()
185 
186     /**
187      * Method getIncludes.
188      * 
189      * @return List
190      */
191     public java.util.List<String> getIncludes()
192     {
193         if ( this.includes == null )
194         {
195             this.includes = new java.util.ArrayList<String>();
196         }
197 
198         return this.includes;
199     } //-- java.util.List<String> getIncludes()
200 
201     /**
202      * Get filesets can be filtered, which means the selected files
203      * will be used as
204      *             <a
205      * href="https://velocity.apache.org/engine/1.5/user-guide.html">Velocity
206      * templates</a>.
207      *             They can be non-filtered, which means the
208      * selected files will be copied without modification.
209      * 
210      * @return boolean
211      */
212     public boolean isFiltered()
213     {
214         return this.filtered;
215     } //-- boolean isFiltered()
216 
217     /**
218      * Get filesets can be packaged, which means the selected files
219      * will be generated/copied in a directory
220      *            structure that is prepended by the package
221      * property. They can be non-packaged, which means that the
222      * selected
223      *            files will be generated/copied without that
224      * prepend.
225      * 
226      * @return boolean
227      */
228     public boolean isPackaged()
229     {
230         return this.packaged;
231     } //-- boolean isPackaged()
232 
233     /**
234      * Method removeExclude.
235      * 
236      * @param string a string object.
237      */
238     public void removeExclude( String string )
239     {
240         getExcludes().remove( string );
241     } //-- void removeExclude( String )
242 
243     /**
244      * Method removeInclude.
245      * 
246      * @param string a string object.
247      */
248     public void removeInclude( String string )
249     {
250         getIncludes().remove( string );
251     } //-- void removeInclude( String )
252 
253     /**
254      * Set the directory where the files will be searched for,
255      * which is also the directory where the
256      *            project's files will be generated.
257      * 
258      * @param directory a directory object.
259      */
260     public void setDirectory( String directory )
261     {
262         this.directory = directory;
263     } //-- void setDirectory( String )
264 
265     /**
266      * Set encoding to use when filtering content.
267      * 
268      * @param encoding a encoding object.
269      */
270     public void setEncoding( String encoding )
271     {
272         this.encoding = encoding;
273     } //-- void setEncoding( String )
274 
275     /**
276      * Set exclusion definition "à la" Ant.
277      * 
278      * @param excludes a excludes object.
279      */
280     public void setExcludes( java.util.List<String> excludes )
281     {
282         this.excludes = excludes;
283     } //-- void setExcludes( java.util.List )
284 
285     /**
286      * Set filesets can be filtered, which means the selected files
287      * will be used as
288      *             <a
289      * href="https://velocity.apache.org/engine/1.5/user-guide.html">Velocity
290      * templates</a>.
291      *             They can be non-filtered, which means the
292      * selected files will be copied without modification.
293      * 
294      * @param filtered a filtered object.
295      */
296     public void setFiltered( boolean filtered )
297     {
298         this.filtered = filtered;
299     } //-- void setFiltered( boolean )
300 
301     /**
302      * Set a string value that should resolve to a boolean value to
303      * conditionally include filesets.
304      *           This condition should be either a boolean as
305      * String or a velocity template language statement that
306      * resolves
307      *           to a boolean value. If the descriptor contains
308      * includeCondition="${shouldInclude}" and the archetype has
309      *           a (required) property like shouldInclude=true the
310      * fileset is included.
311      * 
312      * @param includeCondition a includeCondition object.
313      */
314     public void setIncludeCondition( String includeCondition )
315     {
316         this.includeCondition = includeCondition;
317     } //-- void setIncludeCondition( String )
318 
319     /**
320      * Set inclusion definition "à la" Ant.
321      * 
322      * @param includes a includes object.
323      */
324     public void setIncludes( java.util.List<String> includes )
325     {
326         this.includes = includes;
327     } //-- void setIncludes( java.util.List )
328 
329     /**
330      * Set filesets can be packaged, which means the selected files
331      * will be generated/copied in a directory
332      *            structure that is prepended by the package
333      * property. They can be non-packaged, which means that the
334      * selected
335      *            files will be generated/copied without that
336      * prepend.
337      * 
338      * @param packaged a packaged object.
339      */
340     public void setPackaged( boolean packaged )
341     {
342         this.packaged = packaged;
343     } //-- void setPackaged( boolean )
344 
345     
346     public String toString()
347     {
348         return
349             getDirectory() + " ("
350                 + ( isFiltered() ? "Filtered" : "Copied" )
351                 + "-"
352                 + ( isPackaged() ? "Packaged" : "Flat" )
353             + ") ["
354                 + org.codehaus.plexus.util.StringUtils.join( getIncludes().iterator(), ", " )
355                 + " -- "
356                 + org.codehaus.plexus.util.StringUtils.join( getExcludes().iterator(), ", " )
357             + "]";
358 
359     }
360                     
361 }