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