001    /*
002     =================== DO NOT EDIT THIS FILE ====================
003     Generated by Modello 1.4.1 on 2012-01-20 18:09:18,
004     any modifications will be overwritten.
005     ==============================================================
006     */
007    
008    package org.apache.maven.model;
009    
010    /**
011     * 
012     *         
013     *         The <code>&lt;plugin&gt;</code> element contains
014     * informations required for a report plugin.
015     *         
016     *       
017     * 
018     * @version $Revision$ $Date$
019     */
020    @SuppressWarnings( "all" )
021    public class ReportPlugin
022        extends ConfigurationContainer
023        implements java.io.Serializable, java.lang.Cloneable
024    {
025    
026          //--------------------------/
027         //- Class/Member Variables -/
028        //--------------------------/
029    
030        /**
031         * The group ID of the reporting plugin in the repository.
032         */
033        private String groupId = "org.apache.maven.plugins";
034    
035        /**
036         * The artifact ID of the reporting plugin in the repository.
037         */
038        private String artifactId;
039    
040        /**
041         * The version of the reporting plugin to be used.
042         */
043        private String version;
044    
045        /**
046         * Field reportSets.
047         */
048        private java.util.List<ReportSet> reportSets;
049    
050    
051          //-----------/
052         //- Methods -/
053        //-----------/
054    
055        /**
056         * Method addReportSet.
057         * 
058         * @param reportSet
059         */
060        public void addReportSet( ReportSet reportSet )
061        {
062            getReportSets().add( reportSet );
063        } //-- void addReportSet( ReportSet )
064    
065        /**
066         * Method clone.
067         * 
068         * @return ReportPlugin
069         */
070        public ReportPlugin clone()
071        {
072            try
073            {
074                ReportPlugin copy = (ReportPlugin) super.clone();
075    
076                if ( this.reportSets != null )
077                {
078                    copy.reportSets = new java.util.ArrayList<ReportSet>();
079                    for ( ReportSet item : this.reportSets )
080                    {
081                        copy.reportSets.add( ( (ReportSet) item).clone() );
082                    }
083                }
084    
085                return copy;
086            }
087            catch ( java.lang.Exception ex )
088            {
089                throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
090                    + " does not support clone()" ).initCause( ex );
091            }
092        } //-- ReportPlugin clone()
093    
094        /**
095         * Get the artifact ID of the reporting plugin in the
096         * repository.
097         * 
098         * @return String
099         */
100        public String getArtifactId()
101        {
102            return this.artifactId;
103        } //-- String getArtifactId()
104    
105        /**
106         * Get the group ID of the reporting plugin in the repository.
107         * 
108         * @return String
109         */
110        public String getGroupId()
111        {
112            return this.groupId;
113        } //-- String getGroupId()
114    
115        /**
116         * Method getReportSets.
117         * 
118         * @return List
119         */
120        public java.util.List<ReportSet> getReportSets()
121        {
122            if ( this.reportSets == null )
123            {
124                this.reportSets = new java.util.ArrayList<ReportSet>();
125            }
126    
127            return this.reportSets;
128        } //-- java.util.List<ReportSet> getReportSets()
129    
130        /**
131         * Get the version of the reporting plugin to be used.
132         * 
133         * @return String
134         */
135        public String getVersion()
136        {
137            return this.version;
138        } //-- String getVersion()
139    
140        /**
141         * Method removeReportSet.
142         * 
143         * @param reportSet
144         */
145        public void removeReportSet( ReportSet reportSet )
146        {
147            getReportSets().remove( reportSet );
148        } //-- void removeReportSet( ReportSet )
149    
150        /**
151         * Set the artifact ID of the reporting plugin in the
152         * repository.
153         * 
154         * @param artifactId
155         */
156        public void setArtifactId( String artifactId )
157        {
158            this.artifactId = artifactId;
159        } //-- void setArtifactId( String )
160    
161        /**
162         * Set the group ID of the reporting plugin in the repository.
163         * 
164         * @param groupId
165         */
166        public void setGroupId( String groupId )
167        {
168            this.groupId = groupId;
169        } //-- void setGroupId( String )
170    
171        /**
172         * Set multiple specifications of a set of reports, each having
173         * (possibly) different
174         *             configuration. This is the reporting parallel to
175         * an <code>execution</code> in the build.
176         * 
177         * @param reportSets
178         */
179        public void setReportSets( java.util.List<ReportSet> reportSets )
180        {
181            this.reportSets = reportSets;
182        } //-- void setReportSets( java.util.List )
183    
184        /**
185         * Set the version of the reporting plugin to be used.
186         * 
187         * @param version
188         */
189        public void setVersion( String version )
190        {
191            this.version = version;
192        } //-- void setVersion( String )
193    
194        
195                
196        private java.util.Map<String, ReportSet> reportSetMap = null;
197    
198        /**
199         * Reset the <code>reportSetMap</code> field to <code>null</code>
200         */
201        public void flushReportSetMap()
202        {
203            this.reportSetMap = null;
204        }
205    
206        /**
207         * @return a Map of reportSets field with <code>ReportSet#getId()</code> as key
208         * @see org.apache.maven.model.ReportSet#getId()
209         */
210        public java.util.Map<String, ReportSet> getReportSetsAsMap()
211        {
212            if ( reportSetMap == null )
213            {
214                reportSetMap = new java.util.LinkedHashMap<String, ReportSet>();
215                if ( getReportSets() != null )
216                {
217                    for ( java.util.Iterator<ReportSet> i = getReportSets().iterator(); i.hasNext(); )
218                    {
219                        ReportSet reportSet = (ReportSet) i.next();
220                        reportSetMap.put( reportSet.getId(), reportSet );
221                    }
222                }
223            }
224    
225            return reportSetMap;
226        }
227    
228        /**
229         * @return the key of the report plugin, ie <code>groupId:artifactId</code>
230         */
231        public String getKey()
232        {
233            return constructKey( groupId, artifactId );
234        }
235    
236        /**
237         * @param groupId
238         * @param artifactId
239         * @return the key of the report plugin, ie <code>groupId:artifactId</code>
240         */
241        public static String constructKey( String groupId, String artifactId )
242        {
243            return groupId + ":" + artifactId;
244        }
245                
246              
247    }