View Javadoc

1   /*
2    =================== DO NOT EDIT THIS FILE ====================
3    Generated by Modello 1.4.1 on 2013-02-24 03:31:02,
4    any modifications will be overwritten.
5    ==============================================================
6    */
7   
8   package org.apache.maven.model;
9   
10  /**
11   * Section for management of reports and their configuration.
12   * 
13   * @version $Revision$ $Date$
14   */
15  @SuppressWarnings( "all" )
16  public class Reporting
17      implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
18  {
19  
20        //--------------------------/
21       //- Class/Member Variables -/
22      //--------------------------/
23  
24      /**
25       * 
26       *             
27       *             If true, then the default reports are not
28       * included in the site generation.
29       *             This includes the reports in the "Project Info"
30       * menu. Note: While the type
31       *             of this field is <code>String</code> for
32       * technical reasons, the semantic type is actually
33       *             <code>Boolean</code>. Default value is
34       * <code>false</code>.
35       *             
36       *           
37       */
38      private String excludeDefaults;
39  
40      /**
41       * 
42       *             
43       *             Where to store all of the generated reports. The
44       * default is
45       *             <code>${project.build.directory}/site</code>
46       *             .
47       *             
48       *           
49       */
50      private String outputDirectory;
51  
52      /**
53       * Field plugins.
54       */
55      private java.util.List<ReportPlugin> plugins;
56  
57      /**
58       * Field locations.
59       */
60      private java.util.Map<Object, InputLocation> locations;
61  
62  
63        //-----------/
64       //- Methods -/
65      //-----------/
66  
67      /**
68       * Method addPlugin.
69       * 
70       * @param reportPlugin
71       */
72      public void addPlugin( ReportPlugin reportPlugin )
73      {
74          getPlugins().add( reportPlugin );
75      } //-- void addPlugin( ReportPlugin )
76  
77      /**
78       * Method clone.
79       * 
80       * @return Reporting
81       */
82      public Reporting clone()
83      {
84          try
85          {
86              Reporting copy = (Reporting) super.clone();
87  
88              if ( this.plugins != null )
89              {
90                  copy.plugins = new java.util.ArrayList<ReportPlugin>();
91                  for ( ReportPlugin item : this.plugins )
92                  {
93                      copy.plugins.add( ( (ReportPlugin) item).clone() );
94                  }
95              }
96  
97              if ( copy.locations != null )
98              {
99                  copy.locations = new java.util.LinkedHashMap( copy.locations );
100             }
101 
102             return copy;
103         }
104         catch ( java.lang.Exception ex )
105         {
106             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
107                 + " does not support clone()" ).initCause( ex );
108         }
109     } //-- Reporting clone()
110 
111     /**
112      * Get if true, then the default reports are not included in
113      * the site generation.
114      *             This includes the reports in the "Project Info"
115      * menu. Note: While the type
116      *             of this field is <code>String</code> for
117      * technical reasons, the semantic type is actually
118      *             <code>Boolean</code>. Default value is
119      * <code>false</code>.
120      * 
121      * @return String
122      */
123     public String getExcludeDefaults()
124     {
125         return this.excludeDefaults;
126     } //-- String getExcludeDefaults()
127 
128     /**
129      * 
130      * 
131      * @param key
132      * @return InputLocation
133      */
134     public InputLocation getLocation( Object key )
135     {
136         return ( locations != null ) ? locations.get( key ) : null;
137     } //-- InputLocation getLocation( Object )
138 
139     /**
140      * Get where to store all of the generated reports. The default
141      * is
142      *             <code>${project.build.directory}/site</code>
143      *             .
144      * 
145      * @return String
146      */
147     public String getOutputDirectory()
148     {
149         return this.outputDirectory;
150     } //-- String getOutputDirectory()
151 
152     /**
153      * Method getPlugins.
154      * 
155      * @return List
156      */
157     public java.util.List<ReportPlugin> getPlugins()
158     {
159         if ( this.plugins == null )
160         {
161             this.plugins = new java.util.ArrayList<ReportPlugin>();
162         }
163 
164         return this.plugins;
165     } //-- java.util.List<ReportPlugin> getPlugins()
166 
167     /**
168      * Method removePlugin.
169      * 
170      * @param reportPlugin
171      */
172     public void removePlugin( ReportPlugin reportPlugin )
173     {
174         getPlugins().remove( reportPlugin );
175     } //-- void removePlugin( ReportPlugin )
176 
177     /**
178      * Set if true, then the default reports are not included in
179      * the site generation.
180      *             This includes the reports in the "Project Info"
181      * menu. Note: While the type
182      *             of this field is <code>String</code> for
183      * technical reasons, the semantic type is actually
184      *             <code>Boolean</code>. Default value is
185      * <code>false</code>.
186      * 
187      * @param excludeDefaults
188      */
189     public void setExcludeDefaults( String excludeDefaults )
190     {
191         this.excludeDefaults = excludeDefaults;
192     } //-- void setExcludeDefaults( String )
193 
194     /**
195      * 
196      * 
197      * @param key
198      * @param location
199      */
200     public void setLocation( Object key, InputLocation location )
201     {
202         if ( location != null )
203         {
204             if ( this.locations == null )
205             {
206                 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
207             }
208             this.locations.put( key, location );
209         }
210     } //-- void setLocation( Object, InputLocation )
211 
212     /**
213      * Set where to store all of the generated reports. The default
214      * is
215      *             <code>${project.build.directory}/site</code>
216      *             .
217      * 
218      * @param outputDirectory
219      */
220     public void setOutputDirectory( String outputDirectory )
221     {
222         this.outputDirectory = outputDirectory;
223     } //-- void setOutputDirectory( String )
224 
225     /**
226      * Set the reporting plugins to use and their configuration.
227      * 
228      * @param plugins
229      */
230     public void setPlugins( java.util.List<ReportPlugin> plugins )
231     {
232         this.plugins = plugins;
233     } //-- void setPlugins( java.util.List )
234 
235     
236             
237     public boolean isExcludeDefaults()
238     {
239         return ( excludeDefaults != null ) ? Boolean.parseBoolean( excludeDefaults ) : false;
240     }
241 
242     public void setExcludeDefaults( boolean excludeDefaults )
243     {
244         this.excludeDefaults = String.valueOf( excludeDefaults );
245     }
246 
247     java.util.Map<String, ReportPlugin> reportPluginMap;
248 
249     /**
250      * Reset the <code>reportPluginMap</code> field to <code>null</code>
251      */
252     public synchronized void flushReportPluginMap()
253     {
254         this.reportPluginMap = null;
255     }
256 
257     /**
258      * @return a Map of plugins field with <code>ReportPlugin#getKey()</code> as key
259      * @see org.apache.maven.model.ReportPlugin#getKey()
260      */
261     public synchronized java.util.Map<String, ReportPlugin> getReportPluginsAsMap()
262     {
263         if ( reportPluginMap == null )
264         {
265             reportPluginMap = new java.util.LinkedHashMap<String, ReportPlugin>();
266             if ( getPlugins() != null )
267             {
268                 for ( java.util.Iterator<ReportPlugin> it = getPlugins().iterator(); it.hasNext(); )
269                 {
270                     ReportPlugin reportPlugin = (ReportPlugin) it.next();
271                     reportPluginMap.put( reportPlugin.getKey(), reportPlugin );
272                 }
273             }
274         }
275 
276         return reportPluginMap;
277     }
278             
279           
280 }