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