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