1   
2   
3   
4   
5   
6   package org.apache.maven.model;
7   
8   
9   
10  
11  
12  
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       
21      
22  
23      
24  
25  
26      private String type = "mail";
27  
28      
29  
30  
31      private boolean sendOnError = true;
32  
33      
34  
35  
36      private boolean sendOnFailure = true;
37  
38      
39  
40  
41      private boolean sendOnSuccess = true;
42  
43      
44  
45  
46      private boolean sendOnWarning = true;
47  
48      
49  
50  
51  
52  
53  
54  
55  
56      private String address;
57  
58      
59  
60  
61      private java.util.Properties configuration;
62  
63      
64  
65  
66      private java.util.Map<Object, InputLocation> locations;
67  
68      
69  
70  
71      private InputLocation location;
72  
73      
74  
75  
76      private InputLocation typeLocation;
77  
78      
79  
80  
81      private InputLocation sendOnErrorLocation;
82  
83      
84  
85  
86      private InputLocation sendOnFailureLocation;
87  
88      
89  
90  
91      private InputLocation sendOnSuccessLocation;
92  
93      
94  
95  
96      private InputLocation sendOnWarningLocation;
97  
98      
99  
100 
101     private InputLocation addressLocation;
102 
103     
104 
105 
106     private InputLocation configurationLocation;
107 
108 
109       
110      
111     
112 
113     
114 
115 
116 
117 
118 
119     public void addConfiguration( String key, String value )
120     {
121         getConfiguration().put( key, value );
122     } 
123 
124     
125 
126 
127 
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     } 
153 
154     
155 
156 
157 
158 
159 
160     public String getAddress()
161     {
162         return this.address;
163     } 
164 
165     
166 
167 
168 
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     } 
179 
180     
181 
182 
183 
184 
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     } 
235 
236     
237 
238 
239 
240 
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     } 
300 
301     
302 
303 
304 
305 
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     } 
318 
319     
320 
321 
322 
323 
324 
325     private InputLocation getOtherLocation( Object key )
326     {
327         return ( locations != null ) ? locations.get( key ) : null;
328     } 
329 
330     
331 
332 
333 
334 
335     public String getType()
336     {
337         return this.type;
338     } 
339 
340     
341 
342 
343 
344 
345     public boolean isSendOnError()
346     {
347         return this.sendOnError;
348     } 
349 
350     
351 
352 
353 
354 
355     public boolean isSendOnFailure()
356     {
357         return this.sendOnFailure;
358     } 
359 
360     
361 
362 
363 
364 
365     public boolean isSendOnSuccess()
366     {
367         return this.sendOnSuccess;
368     } 
369 
370     
371 
372 
373 
374 
375     public boolean isSendOnWarning()
376     {
377         return this.sendOnWarning;
378     } 
379 
380     
381 
382 
383 
384 
385 
386     public void setAddress( String address )
387     {
388         this.address = address;
389     } 
390 
391     
392 
393 
394 
395 
396 
397     public void setConfiguration( java.util.Properties configuration )
398     {
399         this.configuration = configuration;
400     } 
401 
402     
403 
404 
405 
406 
407     public void setSendOnError( boolean sendOnError )
408     {
409         this.sendOnError = sendOnError;
410     } 
411 
412     
413 
414 
415 
416 
417     public void setSendOnFailure( boolean sendOnFailure )
418     {
419         this.sendOnFailure = sendOnFailure;
420     } 
421 
422     
423 
424 
425 
426 
427     public void setSendOnSuccess( boolean sendOnSuccess )
428     {
429         this.sendOnSuccess = sendOnSuccess;
430     } 
431 
432     
433 
434 
435 
436 
437     public void setSendOnWarning( boolean sendOnWarning )
438     {
439         this.sendOnWarning = sendOnWarning;
440     } 
441 
442     
443 
444 
445 
446 
447     public void setType( String type )
448     {
449         this.type = type;
450     } 
451 
452 }