View Javadoc

1   /*
2    =================== DO NOT EDIT THIS FILE ====================
3    Generated by Modello 1.4.1 on 2013-02-24 03:31:02,
4    any modifications will be overwritten.
5    ==============================================================
6    */
7   
8   package org.apache.maven.model;
9   
10  /**
11   * Configures one method for notifying users/developers when a
12   * build breaks.
13   * 
14   * @version $Revision$ $Date$
15   */
16  @SuppressWarnings( "all" )
17  public class Notifier
18      implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
19  {
20  
21        //--------------------------/
22       //- Class/Member Variables -/
23      //--------------------------/
24  
25      /**
26       * The mechanism used to deliver notifications.
27       */
28      private String type = "mail";
29  
30      /**
31       * Whether to send notifications on error.
32       */
33      private boolean sendOnError = true;
34  
35      /**
36       * Whether to send notifications on failure.
37       */
38      private boolean sendOnFailure = true;
39  
40      /**
41       * Whether to send notifications on success.
42       */
43      private boolean sendOnSuccess = true;
44  
45      /**
46       * Whether to send notifications on warning.
47       */
48      private boolean sendOnWarning = true;
49  
50      /**
51       * 
52       *             
53       *             <b>Deprecated</b>. Where to send the
54       * notification to - eg email address.
55       *             
56       *           
57       */
58      private String address;
59  
60      /**
61       * Field configuration.
62       */
63      private java.util.Properties configuration;
64  
65      /**
66       * Field locations.
67       */
68      private java.util.Map<Object, InputLocation> locations;
69  
70  
71        //-----------/
72       //- Methods -/
73      //-----------/
74  
75      /**
76       * Method addConfiguration.
77       * 
78       * @param key
79       * @param value
80       */
81      public void addConfiguration( String key, String value )
82      {
83          getConfiguration().put( key, value );
84      } //-- void addConfiguration( String, String )
85  
86      /**
87       * Method clone.
88       * 
89       * @return Notifier
90       */
91      public Notifier clone()
92      {
93          try
94          {
95              Notifier copy = (Notifier) super.clone();
96  
97              if ( this.configuration != null )
98              {
99                  copy.configuration = (java.util.Properties) this.configuration.clone();
100             }
101 
102             if ( copy.locations != null )
103             {
104                 copy.locations = new java.util.LinkedHashMap( copy.locations );
105             }
106 
107             return copy;
108         }
109         catch ( java.lang.Exception ex )
110         {
111             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
112                 + " does not support clone()" ).initCause( ex );
113         }
114     } //-- Notifier clone()
115 
116     /**
117      * Get <b>Deprecated</b>. Where to send the notification to -
118      * eg email address.
119      * 
120      * @return String
121      */
122     public String getAddress()
123     {
124         return this.address;
125     } //-- String getAddress()
126 
127     /**
128      * Method getConfiguration.
129      * 
130      * @return Properties
131      */
132     public java.util.Properties getConfiguration()
133     {
134         if ( this.configuration == null )
135         {
136             this.configuration = new java.util.Properties();
137         }
138 
139         return this.configuration;
140     } //-- java.util.Properties getConfiguration()
141 
142     /**
143      * 
144      * 
145      * @param key
146      * @return InputLocation
147      */
148     public InputLocation getLocation( Object key )
149     {
150         return ( locations != null ) ? locations.get( key ) : null;
151     } //-- InputLocation getLocation( Object )
152 
153     /**
154      * Get the mechanism used to deliver notifications.
155      * 
156      * @return String
157      */
158     public String getType()
159     {
160         return this.type;
161     } //-- String getType()
162 
163     /**
164      * Get whether to send notifications on error.
165      * 
166      * @return boolean
167      */
168     public boolean isSendOnError()
169     {
170         return this.sendOnError;
171     } //-- boolean isSendOnError()
172 
173     /**
174      * Get whether to send notifications on failure.
175      * 
176      * @return boolean
177      */
178     public boolean isSendOnFailure()
179     {
180         return this.sendOnFailure;
181     } //-- boolean isSendOnFailure()
182 
183     /**
184      * Get whether to send notifications on success.
185      * 
186      * @return boolean
187      */
188     public boolean isSendOnSuccess()
189     {
190         return this.sendOnSuccess;
191     } //-- boolean isSendOnSuccess()
192 
193     /**
194      * Get whether to send notifications on warning.
195      * 
196      * @return boolean
197      */
198     public boolean isSendOnWarning()
199     {
200         return this.sendOnWarning;
201     } //-- boolean isSendOnWarning()
202 
203     /**
204      * Set <b>Deprecated</b>. Where to send the notification to -
205      * eg email address.
206      * 
207      * @param address
208      */
209     public void setAddress( String address )
210     {
211         this.address = address;
212     } //-- void setAddress( String )
213 
214     /**
215      * Set extended configuration specific to this notifier goes
216      * here.
217      * 
218      * @param configuration
219      */
220     public void setConfiguration( java.util.Properties configuration )
221     {
222         this.configuration = configuration;
223     } //-- void setConfiguration( java.util.Properties )
224 
225     /**
226      * 
227      * 
228      * @param key
229      * @param location
230      */
231     public void setLocation( Object key, InputLocation location )
232     {
233         if ( location != null )
234         {
235             if ( this.locations == null )
236             {
237                 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
238             }
239             this.locations.put( key, location );
240         }
241     } //-- void setLocation( Object, InputLocation )
242 
243     /**
244      * Set whether to send notifications on error.
245      * 
246      * @param sendOnError
247      */
248     public void setSendOnError( boolean sendOnError )
249     {
250         this.sendOnError = sendOnError;
251     } //-- void setSendOnError( boolean )
252 
253     /**
254      * Set whether to send notifications on failure.
255      * 
256      * @param sendOnFailure
257      */
258     public void setSendOnFailure( boolean sendOnFailure )
259     {
260         this.sendOnFailure = sendOnFailure;
261     } //-- void setSendOnFailure( boolean )
262 
263     /**
264      * Set whether to send notifications on success.
265      * 
266      * @param sendOnSuccess
267      */
268     public void setSendOnSuccess( boolean sendOnSuccess )
269     {
270         this.sendOnSuccess = sendOnSuccess;
271     } //-- void setSendOnSuccess( boolean )
272 
273     /**
274      * Set whether to send notifications on warning.
275      * 
276      * @param sendOnWarning
277      */
278     public void setSendOnWarning( boolean sendOnWarning )
279     {
280         this.sendOnWarning = sendOnWarning;
281     } //-- void setSendOnWarning( boolean )
282 
283     /**
284      * Set the mechanism used to deliver notifications.
285      * 
286      * @param type
287      */
288     public void setType( String type )
289     {
290         this.type = type;
291     } //-- void setType( String )
292 
293 }