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