View Javadoc

1   /*
2    * $Id$
3    */
4   
5   package org.apache.maven.toolchain.model;
6   
7     //---------------------------------/
8    //- Imported classes and packages -/
9   //---------------------------------/
10  
11  import java.util.Date;
12  
13  /**
14   * 
15   *          The <code>&lt;project&gt;</code> element is the root of
16   * the descriptor.
17   *          The following table lists all of the possible child
18   * elements.
19   *             
20   * 
21   * @version $Revision$ $Date$
22   */
23  public class PersistedToolchains implements java.io.Serializable {
24  
25  
26        //--------------------------/
27       //- Class/Member Variables -/
28      //--------------------------/
29  
30      /**
31       * Field toolchains.
32       */
33      private java.util.List toolchains;
34  
35  
36        //-----------/
37       //- Methods -/
38      //-----------/
39  
40      /**
41       * Method addToolchain.
42       * 
43       * @param toolchainModel
44       */
45      public void addToolchain( ToolchainModel toolchainModel )
46      {
47          if ( !(toolchainModel instanceof ToolchainModel) )
48          {
49              throw new ClassCastException( "PersistedToolchains.addToolchains(toolchainModel) parameter must be instanceof " + ToolchainModel.class.getName() );
50          }
51          getToolchains().add( toolchainModel );
52      } //-- void addToolchain( ToolchainModel ) 
53  
54      /**
55       * Method getToolchains.
56       * 
57       * @return java.util.List
58       */
59      public java.util.List getToolchains()
60      {
61          if ( this.toolchains == null )
62          {
63              this.toolchains = new java.util.ArrayList();
64          }
65      
66          return this.toolchains;
67      } //-- java.util.List getToolchains() 
68  
69      /**
70       * Method removeToolchain.
71       * 
72       * @param toolchainModel
73       */
74      public void removeToolchain( ToolchainModel toolchainModel )
75      {
76          if ( !(toolchainModel instanceof ToolchainModel) )
77          {
78              throw new ClassCastException( "PersistedToolchains.removeToolchains(toolchainModel) parameter must be instanceof " + ToolchainModel.class.getName() );
79          }
80          getToolchains().remove( toolchainModel );
81      } //-- void removeToolchain( ToolchainModel ) 
82  
83      /**
84       * Set the toolchain definition.
85       * 
86       * @param toolchains
87       */
88      public void setToolchains( java.util.List toolchains )
89      {
90          this.toolchains = toolchains;
91      } //-- void setToolchains( java.util.List ) 
92  
93  
94      private String modelEncoding = "UTF-8";
95  
96      /**
97       * Set an encoding used for reading/writing the model.
98       *
99       * @param modelEncoding the encoding used when reading/writing the model.
100      */
101     public void setModelEncoding( String modelEncoding )
102     {
103         this.modelEncoding = modelEncoding;
104     }
105 
106     /**
107      * @return the current encoding used when reading/writing this model.
108      */
109     public String getModelEncoding()
110     {
111         return modelEncoding;
112     }
113 }