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   * Root element of the lifecycle.xml file.
15   * 
16   * @version $Revision$ $Date$
17   */
18  public class LifecycleConfiguration implements java.io.Serializable {
19  
20  
21        //--------------------------/
22       //- Class/Member Variables -/
23      //--------------------------/
24  
25      /**
26       * Field lifecycles.
27       */
28      private java.util.List lifecycles;
29  
30  
31        //-----------/
32       //- Methods -/
33      //-----------/
34  
35      /**
36       * Method addLifecycle.
37       * 
38       * @param lifecycle
39       */
40      public void addLifecycle( Lifecycle lifecycle )
41      {
42          if ( !(lifecycle instanceof Lifecycle) )
43          {
44              throw new ClassCastException( "LifecycleConfiguration.addLifecycles(lifecycle) parameter must be instanceof " + Lifecycle.class.getName() );
45          }
46          getLifecycles().add( lifecycle );
47      } //-- void addLifecycle( Lifecycle ) 
48  
49      /**
50       * Method getLifecycles.
51       * 
52       * @return java.util.List
53       */
54      public java.util.List getLifecycles()
55      {
56          if ( this.lifecycles == null )
57          {
58              this.lifecycles = new java.util.ArrayList();
59          }
60      
61          return this.lifecycles;
62      } //-- java.util.List getLifecycles() 
63  
64      /**
65       * Method removeLifecycle.
66       * 
67       * @param lifecycle
68       */
69      public void removeLifecycle( Lifecycle lifecycle )
70      {
71          if ( !(lifecycle instanceof Lifecycle) )
72          {
73              throw new ClassCastException( "LifecycleConfiguration.removeLifecycles(lifecycle) parameter must be instanceof " + Lifecycle.class.getName() );
74          }
75          getLifecycles().remove( lifecycle );
76      } //-- void removeLifecycle( Lifecycle ) 
77  
78      /**
79       * Set the lifecycles field.
80       * 
81       * @param lifecycles
82       */
83      public void setLifecycles( java.util.List lifecycles )
84      {
85          this.lifecycles = lifecycles;
86      } //-- void setLifecycles( java.util.List ) 
87  
88  
89      private String modelEncoding = "UTF-8";
90  
91      /**
92       * Set an encoding used for reading/writing the model.
93       *
94       * @param modelEncoding the encoding used when reading/writing the model.
95       */
96      public void setModelEncoding( String modelEncoding )
97      {
98          this.modelEncoding = modelEncoding;
99      }
100 
101     /**
102      * @return the current encoding used when reading/writing this model.
103      */
104     public String getModelEncoding()
105     {
106         return modelEncoding;
107     }
108 }