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 @SuppressWarnings( "all" )
32 public class Reporting
33 implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
34 {
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54 private String excludeDefaults;
55
56
57
58
59
60
61
62
63
64
65 private String outputDirectory;
66
67
68
69
70 private java.util.List<ReportPlugin> plugins;
71
72
73
74
75 private java.util.Map<Object, InputLocation> locations;
76
77
78
79
80 private InputLocation location;
81
82
83
84
85 private InputLocation excludeDefaultsLocation;
86
87
88
89
90 private InputLocation outputDirectoryLocation;
91
92
93
94
95 private InputLocation pluginsLocation;
96
97
98
99
100
101
102
103
104
105
106
107 public void addPlugin( ReportPlugin reportPlugin )
108 {
109 getPlugins().add( reportPlugin );
110 }
111
112
113
114
115
116
117 public Reporting clone()
118 {
119 try
120 {
121 Reporting copy = (Reporting) super.clone();
122
123 if ( this.plugins != null )
124 {
125 copy.plugins = new java.util.ArrayList<ReportPlugin>();
126 for ( ReportPlugin item : this.plugins )
127 {
128 copy.plugins.add( ( (ReportPlugin) item).clone() );
129 }
130 }
131
132 if ( copy.locations != null )
133 {
134 copy.locations = new java.util.LinkedHashMap( copy.locations );
135 }
136
137 return copy;
138 }
139 catch ( java.lang.Exception ex )
140 {
141 throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
142 + " does not support clone()" ).initCause( ex );
143 }
144 }
145
146
147
148
149
150
151
152
153
154
155
156
157
158 public String getExcludeDefaults()
159 {
160 return this.excludeDefaults;
161 }
162
163
164
165
166
167
168
169 public InputLocation getLocation( Object key )
170 {
171 if ( key instanceof String )
172 {
173 switch ( ( String ) key )
174 {
175 case "" :
176 {
177 return this.location;
178 }
179 case "excludeDefaults" :
180 {
181 return excludeDefaultsLocation;
182 }
183 case "outputDirectory" :
184 {
185 return outputDirectoryLocation;
186 }
187 case "plugins" :
188 {
189 return pluginsLocation;
190 }
191 default :
192 {
193 return getOtherLocation( key );
194 }
195 }
196 }
197 else
198 {
199 return getOtherLocation( key );
200 }
201 }
202
203
204
205
206
207
208
209 public void setLocation( Object key, InputLocation location )
210 {
211 if ( key instanceof String )
212 {
213 switch ( ( String ) key )
214 {
215 case "" :
216 {
217 this.location = location;
218 return;
219 }
220 case "excludeDefaults" :
221 {
222 excludeDefaultsLocation = location;
223 return;
224 }
225 case "outputDirectory" :
226 {
227 outputDirectoryLocation = location;
228 return;
229 }
230 case "plugins" :
231 {
232 pluginsLocation = location;
233 return;
234 }
235 default :
236 {
237 setOtherLocation( key, location );
238 return;
239 }
240 }
241 }
242 else
243 {
244 setOtherLocation( key, location );
245 }
246 }
247
248
249
250
251
252
253
254 public void setOtherLocation( Object key, InputLocation location )
255 {
256 if ( location != null )
257 {
258 if ( this.locations == null )
259 {
260 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
261 }
262 this.locations.put( key, location );
263 }
264 }
265
266
267
268
269
270
271
272 private InputLocation getOtherLocation( Object key )
273 {
274 return ( locations != null ) ? locations.get( key ) : null;
275 }
276
277
278
279
280
281
282
283
284 public String getOutputDirectory()
285 {
286 return this.outputDirectory;
287 }
288
289
290
291
292
293
294 public java.util.List<ReportPlugin> getPlugins()
295 {
296 if ( this.plugins == null )
297 {
298 this.plugins = new java.util.ArrayList<ReportPlugin>();
299 }
300
301 return this.plugins;
302 }
303
304
305
306
307
308
309 public void removePlugin( ReportPlugin reportPlugin )
310 {
311 getPlugins().remove( reportPlugin );
312 }
313
314
315
316
317
318
319
320
321
322
323
324
325
326 public void setExcludeDefaults( String excludeDefaults )
327 {
328 this.excludeDefaults = excludeDefaults;
329 }
330
331
332
333
334
335
336
337
338 public void setOutputDirectory( String outputDirectory )
339 {
340 this.outputDirectory = outputDirectory;
341 }
342
343
344
345
346
347
348 public void setPlugins( java.util.List<ReportPlugin> plugins )
349 {
350 this.plugins = plugins;
351 }
352
353
354
355 public boolean isExcludeDefaults()
356 {
357 return ( excludeDefaults != null ) ? Boolean.parseBoolean( excludeDefaults ) : false;
358 }
359
360 public void setExcludeDefaults( boolean excludeDefaults )
361 {
362 this.excludeDefaults = String.valueOf( excludeDefaults );
363 }
364
365 java.util.Map<String, ReportPlugin> reportPluginMap;
366
367
368
369
370 public synchronized void flushReportPluginMap()
371 {
372 this.reportPluginMap = null;
373 }
374
375
376
377
378
379 public synchronized java.util.Map<String, ReportPlugin> getReportPluginsAsMap()
380 {
381 if ( reportPluginMap == null )
382 {
383 reportPluginMap = new java.util.LinkedHashMap<String, ReportPlugin>();
384 if ( getPlugins() != null )
385 {
386 for ( java.util.Iterator<ReportPlugin> it = getPlugins().iterator(); it.hasNext(); )
387 {
388 ReportPlugin reportPlugin = (ReportPlugin) it.next();
389 reportPluginMap.put( reportPlugin.getKey(), reportPlugin );
390 }
391 }
392 }
393
394 return reportPluginMap;
395 }
396
397
398 }