View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   // Generated by Modello 1.11,
3   // any modifications will be overwritten.
4   // ==============================================================
5   
6   package org.apache.maven.model;
7   
8   /**
9    * Configures one method for notifying users/developers when a
10   * build breaks.
11   * 
12   * @version $Revision$ $Date$
13   */
14  @SuppressWarnings( "all" )
15  public class Notifier
16      implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
17  {
18  
19        //--------------------------/
20       //- Class/Member Variables -/
21      //--------------------------/
22  
23      /**
24       * The mechanism used to deliver notifications.
25       */
26      private String type = "mail";
27  
28      /**
29       * Whether to send notifications on error.
30       */
31      private boolean sendOnError = true;
32  
33      /**
34       * Whether to send notifications on failure.
35       */
36      private boolean sendOnFailure = true;
37  
38      /**
39       * Whether to send notifications on success.
40       */
41      private boolean sendOnSuccess = true;
42  
43      /**
44       * Whether to send notifications on warning.
45       */
46      private boolean sendOnWarning = true;
47  
48      /**
49       * 
50       *             
51       *             <b>Deprecated</b>. Where to send the
52       * notification to - eg email address.
53       *             
54       *           
55       */
56      private String address;
57  
58      /**
59       * Field configuration.
60       */
61      private java.util.Properties configuration;
62  
63      /**
64       * Field locations.
65       */
66      private java.util.Map<Object, InputLocation> locations;
67  
68      /**
69       * Field location.
70       */
71      private InputLocation location;
72  
73      /**
74       * Field typeLocation.
75       */
76      private InputLocation typeLocation;
77  
78      /**
79       * Field sendOnErrorLocation.
80       */
81      private InputLocation sendOnErrorLocation;
82  
83      /**
84       * Field sendOnFailureLocation.
85       */
86      private InputLocation sendOnFailureLocation;
87  
88      /**
89       * Field sendOnSuccessLocation.
90       */
91      private InputLocation sendOnSuccessLocation;
92  
93      /**
94       * Field sendOnWarningLocation.
95       */
96      private InputLocation sendOnWarningLocation;
97  
98      /**
99       * Field addressLocation.
100      */
101     private InputLocation addressLocation;
102 
103     /**
104      * Field configurationLocation.
105      */
106     private InputLocation configurationLocation;
107 
108 
109       //-----------/
110      //- Methods -/
111     //-----------/
112 
113     /**
114      * Method addConfiguration.
115      * 
116      * @param key
117      * @param value
118      */
119     public void addConfiguration( String key, String value )
120     {
121         getConfiguration().put( key, value );
122     } //-- void addConfiguration( String, String )
123 
124     /**
125      * Method clone.
126      * 
127      * @return Notifier
128      */
129     public Notifier clone()
130     {
131         try
132         {
133             Notifier copy = (Notifier) super.clone();
134 
135             if ( this.configuration != null )
136             {
137                 copy.configuration = (java.util.Properties) this.configuration.clone();
138             }
139 
140             if ( copy.locations != null )
141             {
142                 copy.locations = new java.util.LinkedHashMap( copy.locations );
143             }
144 
145             return copy;
146         }
147         catch ( java.lang.Exception ex )
148         {
149             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
150                 + " does not support clone()" ).initCause( ex );
151         }
152     } //-- Notifier clone()
153 
154     /**
155      * Get <b>Deprecated</b>. Where to send the notification to -
156      * eg email address.
157      * 
158      * @return String
159      */
160     public String getAddress()
161     {
162         return this.address;
163     } //-- String getAddress()
164 
165     /**
166      * Method getConfiguration.
167      * 
168      * @return Properties
169      */
170     public java.util.Properties getConfiguration()
171     {
172         if ( this.configuration == null )
173         {
174             this.configuration = new java.util.Properties();
175         }
176 
177         return this.configuration;
178     } //-- java.util.Properties getConfiguration()
179 
180     /**
181      * 
182      * 
183      * @param key
184      * @return InputLocation
185      */
186     public InputLocation getLocation( Object key )
187     {
188         if ( key instanceof String )
189         {
190             switch ( ( String ) key )
191             {
192                 case "" :
193                 {
194                     return this.location;
195                 }
196                 case "type" :
197                 {
198                     return typeLocation;
199                 }
200                 case "sendOnError" :
201                 {
202                     return sendOnErrorLocation;
203                 }
204                 case "sendOnFailure" :
205                 {
206                     return sendOnFailureLocation;
207                 }
208                 case "sendOnSuccess" :
209                 {
210                     return sendOnSuccessLocation;
211                 }
212                 case "sendOnWarning" :
213                 {
214                     return sendOnWarningLocation;
215                 }
216                 case "address" :
217                 {
218                     return addressLocation;
219                 }
220                 case "configuration" :
221                 {
222                     return configurationLocation;
223                 }
224                 default :
225                 {
226                     return getOtherLocation( key );
227                 }
228                 }
229             }
230             else
231             {
232                 return getOtherLocation( key );
233             }
234     } //-- InputLocation getLocation( Object )
235 
236     /**
237      * 
238      * 
239      * @param key
240      * @param location
241      */
242     public void setLocation( Object key, InputLocation location )
243     {
244         if ( key instanceof String )
245         {
246             switch ( ( String ) key )
247             {
248                 case "" :
249                 {
250                     this.location = location;
251                     return;
252                 }
253                 case "type" :
254                 {
255                     typeLocation = location;
256                     return;
257                 }
258                 case "sendOnError" :
259                 {
260                     sendOnErrorLocation = location;
261                     return;
262                 }
263                 case "sendOnFailure" :
264                 {
265                     sendOnFailureLocation = location;
266                     return;
267                 }
268                 case "sendOnSuccess" :
269                 {
270                     sendOnSuccessLocation = location;
271                     return;
272                 }
273                 case "sendOnWarning" :
274                 {
275                     sendOnWarningLocation = location;
276                     return;
277                 }
278                 case "address" :
279                 {
280                     addressLocation = location;
281                     return;
282                 }
283                 case "configuration" :
284                 {
285                     configurationLocation = location;
286                     return;
287                 }
288                 default :
289                 {
290                     setOtherLocation( key, location );
291                     return;
292                 }
293                 }
294             }
295             else
296             {
297                 setOtherLocation( key, location );
298             }
299     } //-- void setLocation( Object, InputLocation )
300 
301     /**
302      * 
303      * 
304      * @param key
305      * @param location
306      */
307     public void setOtherLocation( Object key, InputLocation location )
308     {
309         if ( location != null )
310         {
311             if ( this.locations == null )
312             {
313                 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
314             }
315             this.locations.put( key, location );
316         }
317     } //-- void setOtherLocation( Object, InputLocation )
318 
319     /**
320      * 
321      * 
322      * @param key
323      * @return InputLocation
324      */
325     private InputLocation getOtherLocation( Object key )
326     {
327         return ( locations != null ) ? locations.get( key ) : null;
328     } //-- InputLocation getOtherLocation( Object )
329 
330     /**
331      * Get the mechanism used to deliver notifications.
332      * 
333      * @return String
334      */
335     public String getType()
336     {
337         return this.type;
338     } //-- String getType()
339 
340     /**
341      * Get whether to send notifications on error.
342      * 
343      * @return boolean
344      */
345     public boolean isSendOnError()
346     {
347         return this.sendOnError;
348     } //-- boolean isSendOnError()
349 
350     /**
351      * Get whether to send notifications on failure.
352      * 
353      * @return boolean
354      */
355     public boolean isSendOnFailure()
356     {
357         return this.sendOnFailure;
358     } //-- boolean isSendOnFailure()
359 
360     /**
361      * Get whether to send notifications on success.
362      * 
363      * @return boolean
364      */
365     public boolean isSendOnSuccess()
366     {
367         return this.sendOnSuccess;
368     } //-- boolean isSendOnSuccess()
369 
370     /**
371      * Get whether to send notifications on warning.
372      * 
373      * @return boolean
374      */
375     public boolean isSendOnWarning()
376     {
377         return this.sendOnWarning;
378     } //-- boolean isSendOnWarning()
379 
380     /**
381      * Set <b>Deprecated</b>. Where to send the notification to -
382      * eg email address.
383      * 
384      * @param address
385      */
386     public void setAddress( String address )
387     {
388         this.address = address;
389     } //-- void setAddress( String )
390 
391     /**
392      * Set extended configuration specific to this notifier goes
393      * here.
394      * 
395      * @param configuration
396      */
397     public void setConfiguration( java.util.Properties configuration )
398     {
399         this.configuration = configuration;
400     } //-- void setConfiguration( java.util.Properties )
401 
402     /**
403      * Set whether to send notifications on error.
404      * 
405      * @param sendOnError
406      */
407     public void setSendOnError( boolean sendOnError )
408     {
409         this.sendOnError = sendOnError;
410     } //-- void setSendOnError( boolean )
411 
412     /**
413      * Set whether to send notifications on failure.
414      * 
415      * @param sendOnFailure
416      */
417     public void setSendOnFailure( boolean sendOnFailure )
418     {
419         this.sendOnFailure = sendOnFailure;
420     } //-- void setSendOnFailure( boolean )
421 
422     /**
423      * Set whether to send notifications on success.
424      * 
425      * @param sendOnSuccess
426      */
427     public void setSendOnSuccess( boolean sendOnSuccess )
428     {
429         this.sendOnSuccess = sendOnSuccess;
430     } //-- void setSendOnSuccess( boolean )
431 
432     /**
433      * Set whether to send notifications on warning.
434      * 
435      * @param sendOnWarning
436      */
437     public void setSendOnWarning( boolean sendOnWarning )
438     {
439         this.sendOnWarning = sendOnWarning;
440     } //-- void setSendOnWarning( boolean )
441 
442     /**
443      * Set the mechanism used to deliver notifications.
444      * 
445      * @param type
446      */
447     public void setType( String type )
448     {
449         this.type = type;
450     } //-- void setType( String )
451 
452 }