View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   // Generated by Modello 1.11,
3   // any modifications will be overwritten.
4   // ==============================================================
5   
6   package org.apache.maven.model;
7   
8   /**
9    * Generic informations for a build.
10   * 
11   * @version $Revision$ $Date$
12   */
13  @SuppressWarnings( "all" )
14  public class BuildBase
15      extends PluginConfiguration
16      implements java.io.Serializable, java.lang.Cloneable
17  {
18  
19        //--------------------------/
20       //- Class/Member Variables -/
21      //--------------------------/
22  
23      /**
24       * The default goal (or phase in Maven 2) to execute when none
25       * is specified for
26       *             the project. Note that in case of a multi-module
27       * build, only the default goal of the top-level
28       *             project is relevant, i.e. the default goals of
29       * child modules are ignored. Since Maven 3,
30       *             multiple goals/phases can be separated by
31       * whitespace.
32       */
33      private String defaultGoal;
34  
35      /**
36       * Field resources.
37       */
38      private java.util.List<Resource> resources;
39  
40      /**
41       * Field testResources.
42       */
43      private java.util.List<Resource> testResources;
44  
45      /**
46       * 
47       *             The directory where all files generated by the
48       * build are placed.
49       *             The default value is <code>target</code>.
50       *           
51       */
52      private String directory;
53  
54      /**
55       * 
56       *             
57       *             The filename (excluding the extension, and with
58       * no path information) that
59       *             the produced artifact will be called.
60       *             The default value is
61       * <code>${artifactId}-${version}</code>.
62       *             
63       *           
64       */
65      private String finalName;
66  
67      /**
68       * Field filters.
69       */
70      private java.util.List<String> filters;
71  
72  
73        //-----------/
74       //- Methods -/
75      //-----------/
76  
77      /**
78       * Method addFilter.
79       * 
80       * @param string
81       */
82      public void addFilter( String string )
83      {
84          getFilters().add( string );
85      } //-- void addFilter( String )
86  
87      /**
88       * Method addResource.
89       * 
90       * @param resource
91       */
92      public void addResource( Resource resource )
93      {
94          getResources().add( resource );
95      } //-- void addResource( Resource )
96  
97      /**
98       * Method addTestResource.
99       * 
100      * @param resource
101      */
102     public void addTestResource( Resource resource )
103     {
104         getTestResources().add( resource );
105     } //-- void addTestResource( Resource )
106 
107     /**
108      * Method clone.
109      * 
110      * @return BuildBase
111      */
112     public BuildBase clone()
113     {
114         try
115         {
116             BuildBase copy = (BuildBase) super.clone();
117 
118             if ( this.resources != null )
119             {
120                 copy.resources = new java.util.ArrayList<Resource>();
121                 for ( Resource item : this.resources )
122                 {
123                     copy.resources.add( ( (Resource) item).clone() );
124                 }
125             }
126 
127             if ( this.testResources != null )
128             {
129                 copy.testResources = new java.util.ArrayList<Resource>();
130                 for ( Resource item : this.testResources )
131                 {
132                     copy.testResources.add( ( (Resource) item).clone() );
133                 }
134             }
135 
136             if ( this.filters != null )
137             {
138                 copy.filters = new java.util.ArrayList<String>();
139                 copy.filters.addAll( this.filters );
140             }
141 
142             return copy;
143         }
144         catch ( java.lang.Exception ex )
145         {
146             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
147                 + " does not support clone()" ).initCause( ex );
148         }
149     } //-- BuildBase clone()
150 
151     /**
152      * Get the default goal (or phase in Maven 2) to execute when
153      * none is specified for
154      *             the project. Note that in case of a multi-module
155      * build, only the default goal of the top-level
156      *             project is relevant, i.e. the default goals of
157      * child modules are ignored. Since Maven 3,
158      *             multiple goals/phases can be separated by
159      * whitespace.
160      * 
161      * @return String
162      */
163     public String getDefaultGoal()
164     {
165         return this.defaultGoal;
166     } //-- String getDefaultGoal()
167 
168     /**
169      * Get the directory where all files generated by the build are
170      * placed.
171      *             The default value is <code>target</code>.
172      * 
173      * @return String
174      */
175     public String getDirectory()
176     {
177         return this.directory;
178     } //-- String getDirectory()
179 
180     /**
181      * Method getFilters.
182      * 
183      * @return List
184      */
185     public java.util.List<String> getFilters()
186     {
187         if ( this.filters == null )
188         {
189             this.filters = new java.util.ArrayList<String>();
190         }
191 
192         return this.filters;
193     } //-- java.util.List<String> getFilters()
194 
195     /**
196      * Get the filename (excluding the extension, and with no path
197      * information) that
198      *             the produced artifact will be called.
199      *             The default value is
200      * <code>${artifactId}-${version}</code>.
201      * 
202      * @return String
203      */
204     public String getFinalName()
205     {
206         return this.finalName;
207     } //-- String getFinalName()
208 
209     /**
210      * Method getResources.
211      * 
212      * @return List
213      */
214     public java.util.List<Resource> getResources()
215     {
216         if ( this.resources == null )
217         {
218             this.resources = new java.util.ArrayList<Resource>();
219         }
220 
221         return this.resources;
222     } //-- java.util.List<Resource> getResources()
223 
224     /**
225      * Method getTestResources.
226      * 
227      * @return List
228      */
229     public java.util.List<Resource> getTestResources()
230     {
231         if ( this.testResources == null )
232         {
233             this.testResources = new java.util.ArrayList<Resource>();
234         }
235 
236         return this.testResources;
237     } //-- java.util.List<Resource> getTestResources()
238 
239     /**
240      * Method removeFilter.
241      * 
242      * @param string
243      */
244     public void removeFilter( String string )
245     {
246         getFilters().remove( string );
247     } //-- void removeFilter( String )
248 
249     /**
250      * Method removeResource.
251      * 
252      * @param resource
253      */
254     public void removeResource( Resource resource )
255     {
256         getResources().remove( resource );
257     } //-- void removeResource( Resource )
258 
259     /**
260      * Method removeTestResource.
261      * 
262      * @param resource
263      */
264     public void removeTestResource( Resource resource )
265     {
266         getTestResources().remove( resource );
267     } //-- void removeTestResource( Resource )
268 
269     /**
270      * Set the default goal (or phase in Maven 2) to execute when
271      * none is specified for
272      *             the project. Note that in case of a multi-module
273      * build, only the default goal of the top-level
274      *             project is relevant, i.e. the default goals of
275      * child modules are ignored. Since Maven 3,
276      *             multiple goals/phases can be separated by
277      * whitespace.
278      * 
279      * @param defaultGoal
280      */
281     public void setDefaultGoal( String defaultGoal )
282     {
283         this.defaultGoal = defaultGoal;
284     } //-- void setDefaultGoal( String )
285 
286     /**
287      * Set the directory where all files generated by the build are
288      * placed.
289      *             The default value is <code>target</code>.
290      * 
291      * @param directory
292      */
293     public void setDirectory( String directory )
294     {
295         this.directory = directory;
296     } //-- void setDirectory( String )
297 
298     /**
299      * Set the list of filter properties files that are used when
300      * filtering is enabled.
301      * 
302      * @param filters
303      */
304     public void setFilters( java.util.List<String> filters )
305     {
306         this.filters = filters;
307     } //-- void setFilters( java.util.List )
308 
309     /**
310      * Set the filename (excluding the extension, and with no path
311      * information) that
312      *             the produced artifact will be called.
313      *             The default value is
314      * <code>${artifactId}-${version}</code>.
315      * 
316      * @param finalName
317      */
318     public void setFinalName( String finalName )
319     {
320         this.finalName = finalName;
321     } //-- void setFinalName( String )
322 
323     /**
324      * Set this element describes all of the classpath resources
325      * such as properties
326      *             files associated with a project. These resources
327      * are often included in the final
328      *             package.
329      *             The default value is
330      * <code>src/main/resources</code>.
331      * 
332      * @param resources
333      */
334     public void setResources( java.util.List<Resource> resources )
335     {
336         this.resources = resources;
337     } //-- void setResources( java.util.List )
338 
339     /**
340      * Set this element describes all of the classpath resources
341      * such as properties
342      *             files associated with a project's unit tests.
343      *             The default value is
344      * <code>src/test/resources</code>.
345      * 
346      * @param testResources
347      */
348     public void setTestResources( java.util.List<Resource> testResources )
349     {
350         this.testResources = testResources;
351     } //-- void setTestResources( java.util.List )
352 
353 }