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 @SuppressWarnings( "all" )
21 public class ModelBase
22 implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
23 {
24
25
26
27
28
29
30
31
32 private java.util.List<String> modules;
33
34
35
36
37
38
39
40 private DistributionManagement distributionManagement;
41
42
43
44
45 private java.util.Properties properties;
46
47
48
49
50
51
52
53
54
55
56
57
58 private DependencyManagement dependencyManagement;
59
60
61
62
63 private java.util.List<Dependency> dependencies;
64
65
66
67
68 private java.util.List<Repository> repositories;
69
70
71
72
73 private java.util.List<Repository> pluginRepositories;
74
75
76
77
78
79
80
81
82 private Object reports;
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98 private Reporting reporting;
99
100
101
102
103 private java.util.Map<Object, InputLocation> locations;
104
105
106
107
108
109
110
111
112
113
114
115 public void addDependency( Dependency dependency )
116 {
117 getDependencies().add( dependency );
118 }
119
120
121
122
123
124
125 public void addModule( String string )
126 {
127 getModules().add( string );
128 }
129
130
131
132
133
134
135 public void addPluginRepository( Repository repository )
136 {
137 getPluginRepositories().add( repository );
138 }
139
140
141
142
143
144
145
146 public void addProperty( String key, String value )
147 {
148 getProperties().put( key, value );
149 }
150
151
152
153
154
155
156 public void addRepository( Repository repository )
157 {
158 getRepositories().add( repository );
159 }
160
161
162
163
164
165
166 public ModelBase clone()
167 {
168 try
169 {
170 ModelBase copy = (ModelBase) super.clone();
171
172 if ( this.modules != null )
173 {
174 copy.modules = new java.util.ArrayList<String>();
175 copy.modules.addAll( this.modules );
176 }
177
178 if ( this.distributionManagement != null )
179 {
180 copy.distributionManagement = (DistributionManagement) this.distributionManagement.clone();
181 }
182
183 if ( this.properties != null )
184 {
185 copy.properties = (java.util.Properties) this.properties.clone();
186 }
187
188 if ( this.dependencyManagement != null )
189 {
190 copy.dependencyManagement = (DependencyManagement) this.dependencyManagement.clone();
191 }
192
193 if ( this.dependencies != null )
194 {
195 copy.dependencies = new java.util.ArrayList<Dependency>();
196 for ( Dependency item : this.dependencies )
197 {
198 copy.dependencies.add( ( (Dependency) item).clone() );
199 }
200 }
201
202 if ( this.repositories != null )
203 {
204 copy.repositories = new java.util.ArrayList<Repository>();
205 for ( Repository item : this.repositories )
206 {
207 copy.repositories.add( ( (Repository) item).clone() );
208 }
209 }
210
211 if ( this.pluginRepositories != null )
212 {
213 copy.pluginRepositories = new java.util.ArrayList<Repository>();
214 for ( Repository item : this.pluginRepositories )
215 {
216 copy.pluginRepositories.add( ( (Repository) item).clone() );
217 }
218 }
219
220 if ( this.reports != null )
221 {
222 copy.reports = new org.codehaus.plexus.util.xml.Xpp3Dom( (org.codehaus.plexus.util.xml.Xpp3Dom) this.reports );
223 }
224
225 if ( this.reporting != null )
226 {
227 copy.reporting = (Reporting) this.reporting.clone();
228 }
229
230 if ( copy.locations != null )
231 {
232 copy.locations = new java.util.LinkedHashMap( copy.locations );
233 }
234
235 return copy;
236 }
237 catch ( java.lang.Exception ex )
238 {
239 throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
240 + " does not support clone()" ).initCause( ex );
241 }
242 }
243
244
245
246
247
248
249 public java.util.List<Dependency> getDependencies()
250 {
251 if ( this.dependencies == null )
252 {
253 this.dependencies = new java.util.ArrayList<Dependency>();
254 }
255
256 return this.dependencies;
257 }
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272 public DependencyManagement getDependencyManagement()
273 {
274 return this.dependencyManagement;
275 }
276
277
278
279
280
281
282
283
284
285 public DistributionManagement getDistributionManagement()
286 {
287 return this.distributionManagement;
288 }
289
290
291
292
293
294
295
296 public InputLocation getLocation( Object key )
297 {
298 return ( locations != null ) ? locations.get( key ) : null;
299 }
300
301
302
303
304
305
306 public java.util.List<String> getModules()
307 {
308 if ( this.modules == null )
309 {
310 this.modules = new java.util.ArrayList<String>();
311 }
312
313 return this.modules;
314 }
315
316
317
318
319
320
321 public java.util.List<Repository> getPluginRepositories()
322 {
323 if ( this.pluginRepositories == null )
324 {
325 this.pluginRepositories = new java.util.ArrayList<Repository>();
326 }
327
328 return this.pluginRepositories;
329 }
330
331
332
333
334
335
336 public java.util.Properties getProperties()
337 {
338 if ( this.properties == null )
339 {
340 this.properties = new java.util.Properties();
341 }
342
343 return this.properties;
344 }
345
346
347
348
349
350
351
352
353
354
355
356
357
358 public Reporting getReporting()
359 {
360 return this.reporting;
361 }
362
363
364
365
366
367
368 public Object getReports()
369 {
370 return this.reports;
371 }
372
373
374
375
376
377
378 public java.util.List<Repository> getRepositories()
379 {
380 if ( this.repositories == null )
381 {
382 this.repositories = new java.util.ArrayList<Repository>();
383 }
384
385 return this.repositories;
386 }
387
388
389
390
391
392
393 public void removeDependency( Dependency dependency )
394 {
395 getDependencies().remove( dependency );
396 }
397
398
399
400
401
402
403 public void removeModule( String string )
404 {
405 getModules().remove( string );
406 }
407
408
409
410
411
412
413 public void removePluginRepository( Repository repository )
414 {
415 getPluginRepositories().remove( repository );
416 }
417
418
419
420
421
422
423 public void removeRepository( Repository repository )
424 {
425 getRepositories().remove( repository );
426 }
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443 public void setDependencies( java.util.List<Dependency> dependencies )
444 {
445 this.dependencies = dependencies;
446 }
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461 public void setDependencyManagement( DependencyManagement dependencyManagement )
462 {
463 this.dependencyManagement = dependencyManagement;
464 }
465
466
467
468
469
470
471
472
473
474 public void setDistributionManagement( DistributionManagement distributionManagement )
475 {
476 this.distributionManagement = distributionManagement;
477 }
478
479
480
481
482
483
484
485 public void setLocation( Object key, InputLocation location )
486 {
487 if ( location != null )
488 {
489 if ( this.locations == null )
490 {
491 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
492 }
493 this.locations.put( key, location );
494 }
495 }
496
497
498
499
500
501
502
503
504
505 public void setModules( java.util.List<String> modules )
506 {
507 this.modules = modules;
508 }
509
510
511
512
513
514
515
516
517 public void setPluginRepositories( java.util.List<Repository> pluginRepositories )
518 {
519 this.pluginRepositories = pluginRepositories;
520 }
521
522
523
524
525
526
527
528
529
530
531 public void setProperties( java.util.Properties properties )
532 {
533 this.properties = properties;
534 }
535
536
537
538
539
540
541
542
543
544
545
546
547
548 public void setReporting( Reporting reporting )
549 {
550 this.reporting = reporting;
551 }
552
553
554
555
556
557
558 public void setReports( Object reports )
559 {
560 this.reports = reports;
561 }
562
563
564
565
566
567
568
569
570 public void setRepositories( java.util.List<Repository> repositories )
571 {
572 this.repositories = repositories;
573 }
574
575 }