View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   // Generated by Modello 1.11,
3   // any modifications will be overwritten.
4   // ==============================================================
5   
6   package org.apache.maven.model;
7   
8   /**
9    * 
10   *         
11   *         The <code>&lt;plugin&gt;</code> element contains
12   * informations required for a report plugin.
13   *         
14   *       
15   * 
16   * @version $Revision$ $Date$
17   */
18  @SuppressWarnings( "all" )
19  public class ReportPlugin
20      extends ConfigurationContainer
21      implements java.io.Serializable, java.lang.Cloneable
22  {
23  
24        //--------------------------/
25       //- Class/Member Variables -/
26      //--------------------------/
27  
28      /**
29       * The group ID of the reporting plugin in the repository.
30       */
31      private String groupId = "org.apache.maven.plugins";
32  
33      /**
34       * The artifact ID of the reporting plugin in the repository.
35       */
36      private String artifactId;
37  
38      /**
39       * 
40       *             
41       *             The version of the reporting plugin to be used.
42       * Starting with Maven 3, if no version is defined explicitely,
43       *             version is searched in
44       * <code>build/plugins</code> then in
45       * <code>build/pluginManagement</code>.
46       *             
47       *           
48       */
49      private String version;
50  
51      /**
52       * Field reportSets.
53       */
54      private java.util.List<ReportSet> reportSets;
55  
56  
57        //-----------/
58       //- Methods -/
59      //-----------/
60  
61      /**
62       * Method addReportSet.
63       * 
64       * @param reportSet
65       */
66      public void addReportSet( ReportSet reportSet )
67      {
68          getReportSets().add( reportSet );
69      } //-- void addReportSet( ReportSet )
70  
71      /**
72       * Method clone.
73       * 
74       * @return ReportPlugin
75       */
76      public ReportPlugin clone()
77      {
78          try
79          {
80              ReportPlugin copy = (ReportPlugin) super.clone();
81  
82              if ( this.reportSets != null )
83              {
84                  copy.reportSets = new java.util.ArrayList<ReportSet>();
85                  for ( ReportSet item : this.reportSets )
86                  {
87                      copy.reportSets.add( ( (ReportSet) item).clone() );
88                  }
89              }
90  
91              return copy;
92          }
93          catch ( java.lang.Exception ex )
94          {
95              throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
96                  + " does not support clone()" ).initCause( ex );
97          }
98      } //-- ReportPlugin clone()
99  
100     /**
101      * Get the artifact ID of the reporting plugin in the
102      * repository.
103      * 
104      * @return String
105      */
106     public String getArtifactId()
107     {
108         return this.artifactId;
109     } //-- String getArtifactId()
110 
111     /**
112      * Get the group ID of the reporting plugin in the repository.
113      * 
114      * @return String
115      */
116     public String getGroupId()
117     {
118         return this.groupId;
119     } //-- String getGroupId()
120 
121     /**
122      * Method getReportSets.
123      * 
124      * @return List
125      */
126     public java.util.List<ReportSet> getReportSets()
127     {
128         if ( this.reportSets == null )
129         {
130             this.reportSets = new java.util.ArrayList<ReportSet>();
131         }
132 
133         return this.reportSets;
134     } //-- java.util.List<ReportSet> getReportSets()
135 
136     /**
137      * Get the version of the reporting plugin to be used. Starting
138      * with Maven 3, if no version is defined explicitely,
139      *             version is searched in
140      * <code>build/plugins</code> then in
141      * <code>build/pluginManagement</code>.
142      * 
143      * @return String
144      */
145     public String getVersion()
146     {
147         return this.version;
148     } //-- String getVersion()
149 
150     /**
151      * Method removeReportSet.
152      * 
153      * @param reportSet
154      */
155     public void removeReportSet( ReportSet reportSet )
156     {
157         getReportSets().remove( reportSet );
158     } //-- void removeReportSet( ReportSet )
159 
160     /**
161      * Set the artifact ID of the reporting plugin in the
162      * repository.
163      * 
164      * @param artifactId
165      */
166     public void setArtifactId( String artifactId )
167     {
168         this.artifactId = artifactId;
169     } //-- void setArtifactId( String )
170 
171     /**
172      * Set the group ID of the reporting plugin in the repository.
173      * 
174      * @param groupId
175      */
176     public void setGroupId( String groupId )
177     {
178         this.groupId = groupId;
179     } //-- void setGroupId( String )
180 
181     /**
182      * Set multiple specifications of a set of reports, each having
183      * (possibly) different
184      *             configuration. This is the reporting parallel to
185      * an <code>execution</code> in the build.
186      * 
187      * @param reportSets
188      */
189     public void setReportSets( java.util.List<ReportSet> reportSets )
190     {
191         this.reportSets = reportSets;
192     } //-- void setReportSets( java.util.List )
193 
194     /**
195      * Set the version of the reporting plugin to be used. Starting
196      * with Maven 3, if no version is defined explicitely,
197      *             version is searched in
198      * <code>build/plugins</code> then in
199      * <code>build/pluginManagement</code>.
200      * 
201      * @param version
202      */
203     public void setVersion( String version )
204     {
205         this.version = version;
206     } //-- void setVersion( String )
207 
208     
209             
210     private java.util.Map<String, ReportSet> reportSetMap = null;
211 
212     /**
213      * Reset the <code>reportSetMap</code> field to <code>null</code>
214      */
215     public void flushReportSetMap()
216     {
217         this.reportSetMap = null;
218     }
219 
220     /**
221      * @return a Map of reportSets field with <code>ReportSet#getId()</code> as key
222      * @see org.apache.maven.model.ReportSet#getId()
223      */
224     public java.util.Map<String, ReportSet> getReportSetsAsMap()
225     {
226         if ( reportSetMap == null )
227         {
228             reportSetMap = new java.util.LinkedHashMap<String, ReportSet>();
229             if ( getReportSets() != null )
230             {
231                 for ( java.util.Iterator<ReportSet> i = getReportSets().iterator(); i.hasNext(); )
232                 {
233                     ReportSet reportSet = (ReportSet) i.next();
234                     reportSetMap.put( reportSet.getId(), reportSet );
235                 }
236             }
237         }
238 
239         return reportSetMap;
240     }
241 
242     /**
243      * @return the key of the report plugin, ie <code>groupId:artifactId</code>
244      */
245     public String getKey()
246     {
247         return constructKey( groupId, artifactId );
248     }
249 
250     /**
251      * @param groupId The group ID of the plugin in the repository
252      * @param artifactId The artifact ID of the reporting plugin in the repository
253      * @return the key of the report plugin, ie <code>groupId:artifactId</code>
254      */
255     public static String constructKey( String groupId, String artifactId )
256     {
257         return groupId + ":" + artifactId;
258     }
259             
260           
261 }