001    /*
002     =================== DO NOT EDIT THIS FILE ====================
003     Generated by Modello 1.4.1 on 2013-02-24 03:31:02,
004     any modifications will be overwritten.
005     ==============================================================
006     */
007    
008    package org.apache.maven.model;
009    
010    /**
011     * Section for management of reports and their configuration.
012     * 
013     * @version $Revision$ $Date$
014     */
015    @SuppressWarnings( "all" )
016    public class Reporting
017        implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
018    {
019    
020          //--------------------------/
021         //- Class/Member Variables -/
022        //--------------------------/
023    
024        /**
025         * 
026         *             
027         *             If true, then the default reports are not
028         * included in the site generation.
029         *             This includes the reports in the "Project Info"
030         * menu. Note: While the type
031         *             of this field is <code>String</code> for
032         * technical reasons, the semantic type is actually
033         *             <code>Boolean</code>. Default value is
034         * <code>false</code>.
035         *             
036         *           
037         */
038        private String excludeDefaults;
039    
040        /**
041         * 
042         *             
043         *             Where to store all of the generated reports. The
044         * default is
045         *             <code>${project.build.directory}/site</code>
046         *             .
047         *             
048         *           
049         */
050        private String outputDirectory;
051    
052        /**
053         * Field plugins.
054         */
055        private java.util.List<ReportPlugin> plugins;
056    
057        /**
058         * Field locations.
059         */
060        private java.util.Map<Object, InputLocation> locations;
061    
062    
063          //-----------/
064         //- Methods -/
065        //-----------/
066    
067        /**
068         * Method addPlugin.
069         * 
070         * @param reportPlugin
071         */
072        public void addPlugin( ReportPlugin reportPlugin )
073        {
074            getPlugins().add( reportPlugin );
075        } //-- void addPlugin( ReportPlugin )
076    
077        /**
078         * Method clone.
079         * 
080         * @return Reporting
081         */
082        public Reporting clone()
083        {
084            try
085            {
086                Reporting copy = (Reporting) super.clone();
087    
088                if ( this.plugins != null )
089                {
090                    copy.plugins = new java.util.ArrayList<ReportPlugin>();
091                    for ( ReportPlugin item : this.plugins )
092                    {
093                        copy.plugins.add( ( (ReportPlugin) item).clone() );
094                    }
095                }
096    
097                if ( copy.locations != null )
098                {
099                    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    }