View Javadoc

1   /*
2    * $Id$
3    */
4   
5   package org.apache.maven.model;
6   
7     //---------------------------------/
8    //- Imported classes and packages -/
9   //---------------------------------/
10  
11  import java.util.Date;
12  
13  /**
14   * 
15   *         
16   *         The <code>&lt;CiManagement&gt;</code> element contains
17   * informations required to the
18   *         continuous integration system of the project.
19   *         
20   *       
21   * 
22   * @version $Revision$ $Date$
23   */
24  public class CiManagement implements java.io.Serializable {
25  
26  
27        //--------------------------/
28       //- Class/Member Variables -/
29      //--------------------------/
30  
31      /**
32       * 
33       *             
34       *             The name of the continuous integration system,
35       * e.g. <code>continuum</code>.
36       *             
37       *           
38       */
39      private String system;
40  
41      /**
42       * URL for the continuous integration system used by the
43       * project if it has a web
44       *             interface.
45       */
46      private String url;
47  
48      /**
49       * Field notifiers.
50       */
51      private java.util.List notifiers;
52  
53  
54        //-----------/
55       //- Methods -/
56      //-----------/
57  
58      /**
59       * Method addNotifier.
60       * 
61       * @param notifier
62       */
63      public void addNotifier( Notifier notifier )
64      {
65          if ( !(notifier instanceof Notifier) )
66          {
67              throw new ClassCastException( "CiManagement.addNotifiers(notifier) parameter must be instanceof " + Notifier.class.getName() );
68          }
69          getNotifiers().add( notifier );
70      } //-- void addNotifier( Notifier ) 
71  
72      /**
73       * Method getNotifiers.
74       * 
75       * @return java.util.List
76       */
77      public java.util.List getNotifiers()
78      {
79          if ( this.notifiers == null )
80          {
81              this.notifiers = new java.util.ArrayList();
82          }
83      
84          return this.notifiers;
85      } //-- java.util.List getNotifiers() 
86  
87      /**
88       * Get 
89       *             
90       *             The name of the continuous integration system,
91       * e.g. <code>continuum</code>.
92       *             
93       *           
94       * 
95       * @return String
96       */
97      public String getSystem()
98      {
99          return this.system;
100     } //-- String getSystem() 
101 
102     /**
103      * Get uRL for the continuous integration system used by the
104      * project if it has a web
105      *             interface.
106      * 
107      * @return String
108      */
109     public String getUrl()
110     {
111         return this.url;
112     } //-- String getUrl() 
113 
114     /**
115      * Method removeNotifier.
116      * 
117      * @param notifier
118      */
119     public void removeNotifier( Notifier notifier )
120     {
121         if ( !(notifier instanceof Notifier) )
122         {
123             throw new ClassCastException( "CiManagement.removeNotifiers(notifier) parameter must be instanceof " + Notifier.class.getName() );
124         }
125         getNotifiers().remove( notifier );
126     } //-- void removeNotifier( Notifier ) 
127 
128     /**
129      * Set configuration for notifying developers/users when a
130      * build is unsuccessful,
131      *             including user information and notification
132      * mode.
133      * 
134      * @param notifiers
135      */
136     public void setNotifiers( java.util.List notifiers )
137     {
138         this.notifiers = notifiers;
139     } //-- void setNotifiers( java.util.List ) 
140 
141     /**
142      * Set 
143      *             
144      *             The name of the continuous integration system,
145      * e.g. <code>continuum</code>.
146      *             
147      *           
148      * 
149      * @param system
150      */
151     public void setSystem( String system )
152     {
153         this.system = system;
154     } //-- void setSystem( String ) 
155 
156     /**
157      * Set uRL for the continuous integration system used by the
158      * project if it has a web
159      *             interface.
160      * 
161      * @param url
162      */
163     public void setUrl( String url )
164     {
165         this.url = url;
166     } //-- void setUrl( String ) 
167 
168 
169     private String modelEncoding = "UTF-8";
170 
171     /**
172      * Set an encoding used for reading/writing the model.
173      *
174      * @param modelEncoding the encoding used when reading/writing the model.
175      */
176     public void setModelEncoding( String modelEncoding )
177     {
178         this.modelEncoding = modelEncoding;
179     }
180 
181     /**
182      * @return the current encoding used when reading/writing this model.
183      */
184     public String getModelEncoding()
185     {
186         return modelEncoding;
187     }
188 }