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