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