View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   // Generated by Modello 2.1.2,
3   // any modifications will be overwritten.
4   // ==============================================================
5   
6   package org.apache.maven.model;
7   
8   /**
9    * Section for management of reports and their configuration.
10   * 
11   * @version $Revision$ $Date$
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       //- Class/Member Variables -/
20      //--------------------------/
21  
22      /**
23       * 
24       *             
25       *             If true, then the default reports are not
26       * included in the site generation.
27       *             This includes the reports in the "Project Info"
28       * menu. Note: While the type
29       *             of this field is <code>String</code> for
30       * technical reasons, the semantic type is actually
31       *             <code>Boolean</code>. Default value is
32       * <code>false</code>.
33       *             
34       *           
35       */
36      private String excludeDefaults;
37  
38      /**
39       * 
40       *             
41       *             Where to store all of the generated reports. The
42       * default is
43       *             <code>${project.build.directory}/site</code>.
44       *             
45       *           
46       */
47      private String outputDirectory;
48  
49      /**
50       * Field plugins.
51       */
52      private java.util.List<ReportPlugin> plugins;
53  
54      /**
55       * Field locations.
56       */
57      private java.util.Map<Object, InputLocation> locations;
58  
59      /**
60       * Field location.
61       */
62      private InputLocation location;
63  
64      /**
65       * Field excludeDefaultsLocation.
66       */
67      private InputLocation excludeDefaultsLocation;
68  
69      /**
70       * Field outputDirectoryLocation.
71       */
72      private InputLocation outputDirectoryLocation;
73  
74      /**
75       * Field pluginsLocation.
76       */
77      private InputLocation pluginsLocation;
78  
79  
80        //-----------/
81       //- Methods -/
82      //-----------/
83  
84      /**
85       * Method addPlugin.
86       * 
87       * @param reportPlugin a reportPlugin object.
88       */
89      public void addPlugin( ReportPlugin reportPlugin )
90      {
91          getPlugins().add( reportPlugin );
92      } //-- void addPlugin( ReportPlugin )
93  
94      /**
95       * Method clone.
96       * 
97       * @return Reporting
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     } //-- Reporting clone()
127 
128     /**
129      * Get if true, then the default reports are not included in
130      * the site generation.
131      *             This includes the reports in the "Project Info"
132      * menu. Note: While the type
133      *             of this field is <code>String</code> for
134      * technical reasons, the semantic type is actually
135      *             <code>Boolean</code>. Default value is
136      * <code>false</code>.
137      * 
138      * @return String
139      */
140     public String getExcludeDefaults()
141     {
142         return this.excludeDefaults;
143     } //-- String getExcludeDefaults()
144 
145     /**
146      * 
147      * 
148      * @param key a key object.
149      * @return InputLocation
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     } //-- InputLocation getLocation( Object )
184 
185     /**
186      * 
187      * 
188      * @param key a key object.
189      * @param location a location object.
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     } //-- void setLocation( Object, InputLocation )
229 
230     /**
231      * 
232      * 
233      * @param key a key object.
234      * @param location a location object.
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     } //-- void setOtherLocation( Object, InputLocation )
247 
248     /**
249      * 
250      * 
251      * @param key a key object.
252      * @return InputLocation
253      */
254     private InputLocation getOtherLocation( Object key )
255     {
256         return ( locations != null ) ? locations.get( key ) : null;
257     } //-- InputLocation getOtherLocation( Object )
258 
259     /**
260      * Get where to store all of the generated reports. The default
261      * is
262      *             <code>${project.build.directory}/site</code>.
263      * 
264      * @return String
265      */
266     public String getOutputDirectory()
267     {
268         return this.outputDirectory;
269     } //-- String getOutputDirectory()
270 
271     /**
272      * Method getPlugins.
273      * 
274      * @return List
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     } //-- java.util.List<ReportPlugin> getPlugins()
285 
286     /**
287      * Method removePlugin.
288      * 
289      * @param reportPlugin a reportPlugin object.
290      */
291     public void removePlugin( ReportPlugin reportPlugin )
292     {
293         getPlugins().remove( reportPlugin );
294     } //-- void removePlugin( ReportPlugin )
295 
296     /**
297      * Set if true, then the default reports are not included in
298      * the site generation.
299      *             This includes the reports in the "Project Info"
300      * menu. Note: While the type
301      *             of this field is <code>String</code> for
302      * technical reasons, the semantic type is actually
303      *             <code>Boolean</code>. Default value is
304      * <code>false</code>.
305      * 
306      * @param excludeDefaults a excludeDefaults object.
307      */
308     public void setExcludeDefaults( String excludeDefaults )
309     {
310         this.excludeDefaults = excludeDefaults;
311     } //-- void setExcludeDefaults( String )
312 
313     /**
314      * Set where to store all of the generated reports. The default
315      * is
316      *             <code>${project.build.directory}/site</code>.
317      * 
318      * @param outputDirectory a outputDirectory object.
319      */
320     public void setOutputDirectory( String outputDirectory )
321     {
322         this.outputDirectory = outputDirectory;
323     } //-- void setOutputDirectory( String )
324 
325     /**
326      * Set the reporting plugins to use and their configuration.
327      * 
328      * @param plugins a plugins object.
329      */
330     public void setPlugins( java.util.List<ReportPlugin> plugins )
331     {
332         this.plugins = plugins;
333     } //-- void setPlugins( java.util.List )
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      * Reset the <code>reportPluginMap</code> field to <code>null</code>
351      */
352     public synchronized void flushReportPluginMap()
353     {
354         this.reportPluginMap = null;
355     }
356 
357     /**
358      * @return a Map of plugins field with <code>ReportPlugin#getKey()</code> as key
359      * @see org.apache.maven.model.ReportPlugin#getKey()
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 }