View Javadoc

1   /*
2    * $Id$
3    */
4   
5   package org.apache.maven.plugin.lifecycle;
6   
7     //---------------------------------/
8    //- Imported classes and packages -/
9   //---------------------------------/
10  
11  import java.util.Date;
12  
13  /**
14   * A set of goals to execute.
15   * 
16   * @version $Revision$ $Date$
17   */
18  public class Execution implements java.io.Serializable {
19  
20  
21        //--------------------------/
22       //- Class/Member Variables -/
23      //--------------------------/
24  
25      /**
26       * Configuration to pass to the goals.
27       */
28      private Object configuration;
29  
30      /**
31       * Field goals.
32       */
33      private java.util.List goals;
34  
35  
36        //-----------/
37       //- Methods -/
38      //-----------/
39  
40      /**
41       * Method addGoal.
42       * 
43       * @param string
44       */
45      public void addGoal( String string )
46      {
47          if ( !(string instanceof String) )
48          {
49              throw new ClassCastException( "Execution.addGoals(string) parameter must be instanceof " + String.class.getName() );
50          }
51          getGoals().add( string );
52      } //-- void addGoal( String ) 
53  
54      /**
55       * Get configuration to pass to the goals.
56       * 
57       * @return Object
58       */
59      public Object getConfiguration()
60      {
61          return this.configuration;
62      } //-- Object getConfiguration() 
63  
64      /**
65       * Method getGoals.
66       * 
67       * @return java.util.List
68       */
69      public java.util.List getGoals()
70      {
71          if ( this.goals == null )
72          {
73              this.goals = new java.util.ArrayList();
74          }
75      
76          return this.goals;
77      } //-- java.util.List getGoals() 
78  
79      /**
80       * Method removeGoal.
81       * 
82       * @param string
83       */
84      public void removeGoal( String string )
85      {
86          if ( !(string instanceof String) )
87          {
88              throw new ClassCastException( "Execution.removeGoals(string) parameter must be instanceof " + String.class.getName() );
89          }
90          getGoals().remove( string );
91      } //-- void removeGoal( String ) 
92  
93      /**
94       * Set configuration to pass to the goals.
95       * 
96       * @param configuration
97       */
98      public void setConfiguration( Object configuration )
99      {
100         this.configuration = configuration;
101     } //-- void setConfiguration( Object ) 
102 
103     /**
104      * Set the goals to execute.
105      * 
106      * @param goals
107      */
108     public void setGoals( java.util.List goals )
109     {
110         this.goals = goals;
111     } //-- void setGoals( java.util.List ) 
112 
113 
114     private String modelEncoding = "UTF-8";
115 
116     /**
117      * Set an encoding used for reading/writing the model.
118      *
119      * @param modelEncoding the encoding used when reading/writing the model.
120      */
121     public void setModelEncoding( String modelEncoding )
122     {
123         this.modelEncoding = modelEncoding;
124     }
125 
126     /**
127      * @return the current encoding used when reading/writing this model.
128      */
129     public String getModelEncoding()
130     {
131         return modelEncoding;
132     }
133 }