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.model;
25  
26  /**
27   * 
28   *         
29   *         The <code>&lt;execution&gt;</code> element contains
30   * informations required for the
31   *         execution of a plugin.
32   *         
33   *       
34   * 
35   * @version $Revision$ $Date$
36   */
37  @SuppressWarnings( "all" )
38  public class PluginExecution
39      extends ConfigurationContainer
40      implements java.io.Serializable, java.lang.Cloneable
41  {
42  
43        //--------------------------/
44       //- Class/Member Variables -/
45      //--------------------------/
46  
47      /**
48       * The identifier of this execution for labelling the goals
49       * during the build,
50       *             and for matching executions to merge during
51       * inheritance and profile injection.
52       */
53      private String id = "default";
54  
55      /**
56       * The build lifecycle phase to bind the goals in this
57       * execution to. If omitted,
58       *             the goals will be bound to the default phase
59       * specified by the plugin. 
60       */
61      private String phase;
62  
63      /**
64       * 
65       *             
66       *             The priority of this execution compared to other
67       * executions which are bound to the same phase.
68       *             <strong>Warning:</strong> This is an internal
69       * utility property that is only public for technical reasons,
70       *             it is not part of the public API. In particular,
71       * this property can be changed or deleted without prior
72       *             notice.
73       *             
74       *           
75       */
76      private int priority = 0;
77  
78      /**
79       * Field goals.
80       */
81      private java.util.List<String> goals;
82  
83  
84        //-----------/
85       //- Methods -/
86      //-----------/
87  
88      /**
89       * Method addGoal.
90       * 
91       * @param string a string object.
92       */
93      public void addGoal( String string )
94      {
95          getGoals().add( string );
96      } //-- void addGoal( String )
97  
98      /**
99       * Method clone.
100      * 
101      * @return PluginExecution
102      */
103     public PluginExecution clone()
104     {
105         try
106         {
107             PluginExecution copy = (PluginExecution) super.clone();
108 
109             if ( this.goals != null )
110             {
111                 copy.goals = new java.util.ArrayList<String>();
112                 copy.goals.addAll( this.goals );
113             }
114 
115             return copy;
116         }
117         catch ( java.lang.Exception ex )
118         {
119             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
120                 + " does not support clone()" ).initCause( ex );
121         }
122     } //-- PluginExecution clone()
123 
124     /**
125      * Method getGoals.
126      * 
127      * @return List
128      */
129     public java.util.List<String> getGoals()
130     {
131         if ( this.goals == null )
132         {
133             this.goals = new java.util.ArrayList<String>();
134         }
135 
136         return this.goals;
137     } //-- java.util.List<String> getGoals()
138 
139     /**
140      * Get the identifier of this execution for labelling the goals
141      * during the build,
142      *             and for matching executions to merge during
143      * inheritance and profile injection.
144      * 
145      * @return String
146      */
147     public String getId()
148     {
149         return this.id;
150     } //-- String getId()
151 
152     /**
153      * Get the build lifecycle phase to bind the goals in this
154      * execution to. If omitted,
155      *             the goals will be bound to the default phase
156      * specified by the plugin.
157      * 
158      * @return String
159      */
160     public String getPhase()
161     {
162         return this.phase;
163     } //-- String getPhase()
164 
165     /**
166      * Get the priority of this execution compared to other
167      * executions which are bound to the same phase.
168      *             <strong>Warning:</strong> This is an internal
169      * utility property that is only public for technical reasons,
170      *             it is not part of the public API. In particular,
171      * this property can be changed or deleted without prior
172      *             notice.
173      * 
174      * @return int
175      */
176     public int getPriority()
177     {
178         return this.priority;
179     } //-- int getPriority()
180 
181     /**
182      * Method removeGoal.
183      * 
184      * @param string a string object.
185      */
186     public void removeGoal( String string )
187     {
188         getGoals().remove( string );
189     } //-- void removeGoal( String )
190 
191     /**
192      * Set the goals to execute with the given configuration.
193      * 
194      * @param goals a goals object.
195      */
196     public void setGoals( java.util.List<String> goals )
197     {
198         this.goals = goals;
199     } //-- void setGoals( java.util.List )
200 
201     /**
202      * Set the identifier of this execution for labelling the goals
203      * during the build,
204      *             and for matching executions to merge during
205      * inheritance and profile injection.
206      * 
207      * @param id a id object.
208      */
209     public void setId( String id )
210     {
211         this.id = id;
212     } //-- void setId( String )
213 
214     /**
215      * Set the build lifecycle phase to bind the goals in this
216      * execution to. If omitted,
217      *             the goals will be bound to the default phase
218      * specified by the plugin.
219      * 
220      * @param phase a phase object.
221      */
222     public void setPhase( String phase )
223     {
224         this.phase = phase;
225     } //-- void setPhase( String )
226 
227     /**
228      * Set the priority of this execution compared to other
229      * executions which are bound to the same phase.
230      *             <strong>Warning:</strong> This is an internal
231      * utility property that is only public for technical reasons,
232      *             it is not part of the public API. In particular,
233      * this property can be changed or deleted without prior
234      *             notice.
235      * 
236      * @param priority a priority object.
237      */
238     public void setPriority( int priority )
239     {
240         this.priority = priority;
241     } //-- void setPriority( int )
242 
243     
244             
245     public static final String DEFAULT_EXECUTION_ID = "default";
246 
247     @Override
248     public String toString()
249     {
250         return getId();
251     }
252             
253           
254 }