001// =================== DO NOT EDIT THIS FILE ====================
002// Generated by Modello 1.8.3,
003// any modifications will be overwritten.
004// ==============================================================
005
006package org.apache.maven.model;
007
008/**
009 * Section for management of reports and their configuration.
010 * 
011 * @version $Revision$ $Date$
012 */
013@SuppressWarnings( "all" )
014public class Reporting
015    implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
016{
017
018      //--------------------------/
019     //- Class/Member Variables -/
020    //--------------------------/
021
022    /**
023     * 
024     *             
025     *             If true, then the default reports are not
026     * included in the site generation.
027     *             This includes the reports in the "Project Info"
028     * menu. Note: While the type
029     *             of this field is <code>String</code> for
030     * technical reasons, the semantic type is actually
031     *             <code>Boolean</code>. Default value is
032     * <code>false</code>.
033     *             
034     *           
035     */
036    private String excludeDefaults;
037
038    /**
039     * 
040     *             
041     *             Where to store all of the generated reports. The
042     * default is
043     *             <code>${project.build.directory}/site</code>.
044     *             
045     *           
046     */
047    private String outputDirectory;
048
049    /**
050     * Field plugins.
051     */
052    private java.util.List<ReportPlugin> plugins;
053
054    /**
055     * Field locations.
056     */
057    private java.util.Map<Object, InputLocation> locations;
058
059
060      //-----------/
061     //- Methods -/
062    //-----------/
063
064    /**
065     * Method addPlugin.
066     * 
067     * @param reportPlugin
068     */
069    public void addPlugin( ReportPlugin reportPlugin )
070    {
071        getPlugins().add( reportPlugin );
072    } //-- void addPlugin( ReportPlugin )
073
074    /**
075     * Method clone.
076     * 
077     * @return Reporting
078     */
079    public Reporting clone()
080    {
081        try
082        {
083            Reporting copy = (Reporting) super.clone();
084
085            if ( this.plugins != null )
086            {
087                copy.plugins = new java.util.ArrayList<ReportPlugin>();
088                for ( ReportPlugin item : this.plugins )
089                {
090                    copy.plugins.add( ( (ReportPlugin) item).clone() );
091                }
092            }
093
094            if ( copy.locations != null )
095            {
096                copy.locations = new java.util.LinkedHashMap( copy.locations );
097            }
098
099            return copy;
100        }
101        catch ( java.lang.Exception ex )
102        {
103            throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
104                + " does not support clone()" ).initCause( ex );
105        }
106    } //-- Reporting clone()
107
108    /**
109     * Get if true, then the default reports are not included in
110     * the site generation.
111     *             This includes the reports in the "Project Info"
112     * menu. Note: While the type
113     *             of this field is <code>String</code> for
114     * technical reasons, the semantic type is actually
115     *             <code>Boolean</code>. Default value is
116     * <code>false</code>.
117     * 
118     * @return String
119     */
120    public String getExcludeDefaults()
121    {
122        return this.excludeDefaults;
123    } //-- String getExcludeDefaults()
124
125    /**
126     * 
127     * 
128     * @param key
129     * @return InputLocation
130     */
131    public InputLocation getLocation( Object key )
132    {
133        return ( locations != null ) ? locations.get( key ) : null;
134    } //-- InputLocation getLocation( Object )
135
136    /**
137     * Get where to store all of the generated reports. The default
138     * is
139     *             <code>${project.build.directory}/site</code>.
140     * 
141     * @return String
142     */
143    public String getOutputDirectory()
144    {
145        return this.outputDirectory;
146    } //-- String getOutputDirectory()
147
148    /**
149     * Method getPlugins.
150     * 
151     * @return List
152     */
153    public java.util.List<ReportPlugin> getPlugins()
154    {
155        if ( this.plugins == null )
156        {
157            this.plugins = new java.util.ArrayList<ReportPlugin>();
158        }
159
160        return this.plugins;
161    } //-- java.util.List<ReportPlugin> getPlugins()
162
163    /**
164     * Method removePlugin.
165     * 
166     * @param reportPlugin
167     */
168    public void removePlugin( ReportPlugin reportPlugin )
169    {
170        getPlugins().remove( reportPlugin );
171    } //-- void removePlugin( ReportPlugin )
172
173    /**
174     * Set if true, then the default reports are not included in
175     * the site generation.
176     *             This includes the reports in the "Project Info"
177     * menu. Note: While the type
178     *             of this field is <code>String</code> for
179     * technical reasons, the semantic type is actually
180     *             <code>Boolean</code>. Default value is
181     * <code>false</code>.
182     * 
183     * @param excludeDefaults
184     */
185    public void setExcludeDefaults( String excludeDefaults )
186    {
187        this.excludeDefaults = excludeDefaults;
188    } //-- void setExcludeDefaults( String )
189
190    /**
191     * 
192     * 
193     * @param key
194     * @param location
195     */
196    public void setLocation( Object key, InputLocation location )
197    {
198        if ( location != null )
199        {
200            if ( this.locations == null )
201            {
202                this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
203            }
204            this.locations.put( key, location );
205        }
206    } //-- void setLocation( Object, InputLocation )
207
208    /**
209     * Set where to store all of the generated reports. The default
210     * is
211     *             <code>${project.build.directory}/site</code>.
212     * 
213     * @param outputDirectory
214     */
215    public void setOutputDirectory( String outputDirectory )
216    {
217        this.outputDirectory = outputDirectory;
218    } //-- void setOutputDirectory( String )
219
220    /**
221     * Set the reporting plugins to use and their configuration.
222     * 
223     * @param plugins
224     */
225    public void setPlugins( java.util.List<ReportPlugin> plugins )
226    {
227        this.plugins = plugins;
228    } //-- void setPlugins( java.util.List )
229
230    
231            
232    public boolean isExcludeDefaults()
233    {
234        return ( excludeDefaults != null ) ? Boolean.parseBoolean( excludeDefaults ) : false;
235    }
236
237    public void setExcludeDefaults( boolean excludeDefaults )
238    {
239        this.excludeDefaults = String.valueOf( excludeDefaults );
240    }
241
242    java.util.Map<String, ReportPlugin> reportPluginMap;
243
244    /**
245     * Reset the <code>reportPluginMap</code> field to <code>null</code>
246     */
247    public synchronized void flushReportPluginMap()
248    {
249        this.reportPluginMap = null;
250    }
251
252    /**
253     * @return a Map of plugins field with <code>ReportPlugin#getKey()</code> as key
254     * @see org.apache.maven.model.ReportPlugin#getKey()
255     */
256    public synchronized java.util.Map<String, ReportPlugin> getReportPluginsAsMap()
257    {
258        if ( reportPluginMap == null )
259        {
260            reportPluginMap = new java.util.LinkedHashMap<String, ReportPlugin>();
261            if ( getPlugins() != null )
262            {
263                for ( java.util.Iterator<ReportPlugin> it = getPlugins().iterator(); it.hasNext(); )
264                {
265                    ReportPlugin reportPlugin = (ReportPlugin) it.next();
266                    reportPluginMap.put( reportPlugin.getKey(), reportPlugin );
267                }
268            }
269        }
270
271        return reportPluginMap;
272    }
273            
274          
275}