1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package org.apache.maven.model;
25
26
27
28
29
30
31
32
33
34
35
36
37 @SuppressWarnings( "all" )
38 public class License
39 implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
40 {
41
42
43
44
45
46
47
48
49 private String name;
50
51
52
53
54 private String url;
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72 private String distribution;
73
74
75
76
77 private String comments;
78
79
80
81
82 private java.util.Map<Object, InputLocation> locations;
83
84
85
86
87 private InputLocation location;
88
89
90
91
92 private InputLocation nameLocation;
93
94
95
96
97 private InputLocation urlLocation;
98
99
100
101
102 private InputLocation distributionLocation;
103
104
105
106
107 private InputLocation commentsLocation;
108
109
110
111
112
113
114
115
116
117
118
119 public License clone()
120 {
121 try
122 {
123 License copy = (License) super.clone();
124
125 if ( copy.locations != null )
126 {
127 copy.locations = new java.util.LinkedHashMap( copy.locations );
128 }
129
130 return copy;
131 }
132 catch ( java.lang.Exception ex )
133 {
134 throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
135 + " does not support clone()" ).initCause( ex );
136 }
137 }
138
139
140
141
142
143
144 public String getComments()
145 {
146 return this.comments;
147 }
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163 public String getDistribution()
164 {
165 return this.distribution;
166 }
167
168
169
170
171
172
173
174 public InputLocation getLocation( Object key )
175 {
176 if ( key instanceof String )
177 {
178 switch ( ( String ) key )
179 {
180 case "" :
181 {
182 return this.location;
183 }
184 case "name" :
185 {
186 return nameLocation;
187 }
188 case "url" :
189 {
190 return urlLocation;
191 }
192 case "distribution" :
193 {
194 return distributionLocation;
195 }
196 case "comments" :
197 {
198 return commentsLocation;
199 }
200 default :
201 {
202 return getOtherLocation( key );
203 }
204 }
205 }
206 else
207 {
208 return getOtherLocation( key );
209 }
210 }
211
212
213
214
215
216
217 public String getName()
218 {
219 return this.name;
220 }
221
222
223
224
225
226
227
228 public void setLocation( Object key, InputLocation location )
229 {
230 if ( key instanceof String )
231 {
232 switch ( ( String ) key )
233 {
234 case "" :
235 {
236 this.location = location;
237 return;
238 }
239 case "name" :
240 {
241 nameLocation = location;
242 return;
243 }
244 case "url" :
245 {
246 urlLocation = location;
247 return;
248 }
249 case "distribution" :
250 {
251 distributionLocation = location;
252 return;
253 }
254 case "comments" :
255 {
256 commentsLocation = location;
257 return;
258 }
259 default :
260 {
261 setOtherLocation( key, location );
262 return;
263 }
264 }
265 }
266 else
267 {
268 setOtherLocation( key, location );
269 }
270 }
271
272
273
274
275
276
277
278 public void setOtherLocation( Object key, InputLocation location )
279 {
280 if ( location != null )
281 {
282 if ( this.locations == null )
283 {
284 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
285 }
286 this.locations.put( key, location );
287 }
288 }
289
290
291
292
293
294
295
296 private InputLocation getOtherLocation( Object key )
297 {
298 return ( locations != null ) ? locations.get( key ) : null;
299 }
300
301
302
303
304
305
306 public String getUrl()
307 {
308 return this.url;
309 }
310
311
312
313
314
315
316 public void setComments( String comments )
317 {
318 this.comments = comments;
319 }
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335 public void setDistribution( String distribution )
336 {
337 this.distribution = distribution;
338 }
339
340
341
342
343
344
345 public void setName( String name )
346 {
347 this.name = name;
348 }
349
350
351
352
353
354
355 public void setUrl( String url )
356 {
357 this.url = url;
358 }
359
360
361
362
363
364
365 public String toString()
366 {
367 return "License {name=" + name + ", url=" + url + "}";
368 }
369
370
371 }