View Javadoc

1   /*
2    =================== DO NOT EDIT THIS FILE ====================
3    Generated by Modello 1.4.1 on 2012-01-20 18:05:12,
4    any modifications will be overwritten.
5    ==============================================================
6    */
7   
8   package org.apache.maven.model;
9   
10  /**
11   * 
12   *         
13   *         The <code>&lt;plugin&gt;</code> element contains
14   * informations required for a report plugin.
15   *         
16   *       
17   * 
18   * @version $Revision$ $Date$
19   */
20  @SuppressWarnings( "all" )
21  public class ReportPlugin
22      extends ConfigurationContainer
23      implements java.io.Serializable, java.lang.Cloneable
24  {
25  
26        //--------------------------/
27       //- Class/Member Variables -/
28      //--------------------------/
29  
30      /**
31       * The group ID of the reporting plugin in the repository.
32       */
33      private String groupId = "org.apache.maven.plugins";
34  
35      /**
36       * The artifact ID of the reporting plugin in the repository.
37       */
38      private String artifactId;
39  
40      /**
41       * The version of the reporting plugin to be used.
42       */
43      private String version;
44  
45      /**
46       * Field reportSets.
47       */
48      private java.util.List<ReportSet> reportSets;
49  
50  
51        //-----------/
52       //- Methods -/
53      //-----------/
54  
55      /**
56       * Method addReportSet.
57       * 
58       * @param reportSet
59       */
60      public void addReportSet( ReportSet reportSet )
61      {
62          getReportSets().add( reportSet );
63      } //-- void addReportSet( ReportSet )
64  
65      /**
66       * Method clone.
67       * 
68       * @return ReportPlugin
69       */
70      public ReportPlugin clone()
71      {
72          try
73          {
74              ReportPlugin copy = (ReportPlugin) super.clone();
75  
76              if ( this.reportSets != null )
77              {
78                  copy.reportSets = new java.util.ArrayList<ReportSet>();
79                  for ( ReportSet item : this.reportSets )
80                  {
81                      copy.reportSets.add( ( (ReportSet) item).clone() );
82                  }
83              }
84  
85              return copy;
86          }
87          catch ( java.lang.Exception ex )
88          {
89              throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
90                  + " does not support clone()" ).initCause( ex );
91          }
92      } //-- ReportPlugin clone()
93  
94      /**
95       * Get the artifact ID of the reporting plugin in the
96       * repository.
97       * 
98       * @return String
99       */
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 }