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   */
19  package org.apache.maven.plugin.lifecycle;
20  
21  /**
22   * A phase mapping definition.
23   *
24   * @version $Revision$ $Date$
25   */
26  @SuppressWarnings("all")
27  public class Phase implements java.io.Serializable {
28  
29      // --------------------------/
30      // - Class/Member Variables -/
31      // --------------------------/
32  
33      /**
34       * The ID of this phase, e.g., <code>generate-sources</code>.
35       */
36      private String id;
37  
38      /**
39       * Field executions.
40       */
41      private java.util.List<Execution> executions;
42  
43      /**
44       * Configuration to pass to all goals run in this phase.
45       */
46      private Object configuration;
47  
48      // -----------/
49      // - Methods -/
50      // -----------/
51  
52      /**
53       * Method addExecution.
54       *
55       * @param execution a execution object.
56       */
57      public void addExecution(Execution execution) {
58          getExecutions().add(execution);
59      } // -- void addExecution( Execution )
60  
61      /**
62       * Get configuration to pass to all goals run in this phase.
63       *
64       * @return Object
65       */
66      public Object getConfiguration() {
67          return this.configuration;
68      } // -- Object getConfiguration()
69  
70      /**
71       * Method getExecutions.
72       *
73       * @return List
74       */
75      public java.util.List<Execution> getExecutions() {
76          if (this.executions == null) {
77              this.executions = new java.util.ArrayList<Execution>();
78          }
79  
80          return this.executions;
81      } // -- java.util.List<Execution> getExecutions()
82  
83      /**
84       * Get the ID of this phase, e.g.,
85       * <code>generate-sources</code>.
86       *
87       * @return String
88       */
89      public String getId() {
90          return this.id;
91      } // -- String getId()
92  
93      /**
94       * Method removeExecution.
95       *
96       * @param execution a execution object.
97       */
98      public void removeExecution(Execution execution) {
99          getExecutions().remove(execution);
100     } // -- void removeExecution( Execution )
101 
102     /**
103      * Set configuration to pass to all goals run in this phase.
104      *
105      * @param configuration a configuration object.
106      */
107     public void setConfiguration(Object configuration) {
108         this.configuration = configuration;
109     } // -- void setConfiguration( Object )
110 
111     /**
112      * Set the goals to execute within the phase.
113      *
114      * @param executions a executions object.
115      */
116     public void setExecutions(java.util.List<Execution> executions) {
117         this.executions = executions;
118     } // -- void setExecutions( java.util.List )
119 
120     /**
121      * Set the ID of this phase, e.g.,
122      * <code>generate-sources</code>.
123      *
124      * @param id a id object.
125      */
126     public void setId(String id) {
127         this.id = id;
128     } // -- void setId( String )
129 }