1
2
3
4
5
6
7
8 package org.apache.maven.model;
9
10
11
12
13
14
15
16
17
18
19
20 public class ReportPlugin
21 implements java.io.Serializable
22 {
23
24
25
26
27
28
29
30
31 private String groupId = "org.apache.maven.plugins";
32
33
34
35
36 private String artifactId;
37
38
39
40
41 private String version;
42
43
44
45
46
47
48 private String inherited;
49
50
51
52
53 private Object configuration;
54
55
56
57
58 private java.util.List<ReportSet> reportSets;
59
60
61
62
63
64
65
66
67
68
69
70 public void addReportSet( ReportSet reportSet )
71 {
72 if ( !(reportSet instanceof ReportSet) )
73 {
74 throw new ClassCastException( "ReportPlugin.addReportSets(reportSet) parameter must be instanceof " + ReportSet.class.getName() );
75 }
76 getReportSets().add( reportSet );
77 }
78
79
80
81
82
83
84
85 public String getArtifactId()
86 {
87 return this.artifactId;
88 }
89
90
91
92
93
94
95 public Object getConfiguration()
96 {
97 return this.configuration;
98 }
99
100
101
102
103
104
105 public String getGroupId()
106 {
107 return this.groupId;
108 }
109
110
111
112
113
114
115
116
117 public String getInherited()
118 {
119 return this.inherited;
120 }
121
122
123
124
125
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 }
136
137
138
139
140
141
142 public String getVersion()
143 {
144 return this.version;
145 }
146
147
148
149
150
151
152 public void removeReportSet( ReportSet reportSet )
153 {
154 if ( !(reportSet instanceof ReportSet) )
155 {
156 throw new ClassCastException( "ReportPlugin.removeReportSets(reportSet) parameter must be instanceof " + ReportSet.class.getName() );
157 }
158 getReportSets().remove( reportSet );
159 }
160
161
162
163
164
165
166
167 public void setArtifactId( String artifactId )
168 {
169 this.artifactId = artifactId;
170 }
171
172
173
174
175
176
177 public void setConfiguration( Object configuration )
178 {
179 this.configuration = configuration;
180 }
181
182
183
184
185
186
187 public void setGroupId( String groupId )
188 {
189 this.groupId = groupId;
190 }
191
192
193
194
195
196
197
198
199 public void setInherited( String inherited )
200 {
201 this.inherited = inherited;
202 }
203
204
205
206
207
208
209
210
211
212 public void setReportSets( java.util.List<ReportSet> reportSets )
213 {
214 this.reportSets = reportSets;
215 }
216
217
218
219
220
221
222 public void setVersion( String version )
223 {
224 this.version = version;
225 }
226
227
228
229 private java.util.Map reportSetMap = null;
230
231
232
233
234 public void flushReportSetMap()
235 {
236 this.reportSetMap = null;
237 }
238
239
240
241
242
243 public java.util.Map getReportSetsAsMap()
244 {
245 if ( reportSetMap == null )
246 {
247 reportSetMap = new java.util.LinkedHashMap();
248 if ( getReportSets() != null )
249 {
250 for ( java.util.Iterator i = getReportSets().iterator(); i.hasNext(); )
251 {
252 ReportSet reportSet = (ReportSet) i.next();
253 reportSetMap.put( reportSet.getId(), reportSet );
254 }
255 }
256 }
257
258 return reportSetMap;
259 }
260
261
262
263
264 public String getKey()
265 {
266 return constructKey( groupId, artifactId );
267 }
268
269
270
271
272
273
274 public static String constructKey( String groupId, String artifactId )
275 {
276 return groupId + ":" + artifactId;
277 }
278
279 private boolean inheritanceApplied = true;
280
281 public void unsetInheritanceApplied()
282 {
283 this.inheritanceApplied = false;
284 }
285
286 public boolean isInheritanceApplied()
287 {
288 return inheritanceApplied;
289 }
290
291
292
293
294 public boolean equals( Object other )
295 {
296 if ( other instanceof ReportPlugin )
297 {
298 ReportPlugin otherPlugin = (ReportPlugin) other;
299
300 return getKey().equals( otherPlugin.getKey() );
301 }
302
303 return false;
304 }
305
306
307
308
309 public int hashCode()
310 {
311 return getKey().hashCode();
312 }
313
314
315
316
317 public String toString()
318 {
319 return "ReportPlugin [" + getKey() + "]";
320 }
321
322
323 }