View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   // Generated by Modello 1.8.3,
3   // any modifications will be overwritten.
4   // ==============================================================
5   
6   package org.apache.maven.model;
7   
8   /**
9    * 
10   *         
11   *         Base class for the <code>Model</code> and the
12   * <code>Profile</code> objects.
13   *         
14   *       
15   * 
16   * @version $Revision: 965443 $ $Date: 2015-09-14 15:18:52 -0700 (Mon, 14 Sep 2015) $
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       //- Class/Member Variables -/
25      //--------------------------/
26  
27      /**
28       * Field modules.
29       */
30      private java.util.List<String> modules;
31  
32      /**
33       * Distribution information for a project that enables
34       * deployment of the site
35       *             and artifacts to remote web servers and
36       * repositories respectively.
37       */
38      private DistributionManagement distributionManagement;
39  
40      /**
41       * Field properties.
42       */
43      private java.util.Properties properties;
44  
45      /**
46       * Default dependency information for projects that inherit
47       * from this one. The
48       *             dependencies in this section are not immediately
49       * resolved. Instead, when a POM derived
50       *             from this one declares a dependency described by
51       * a matching groupId and artifactId, the
52       *             version and other values from this section are
53       * used for that dependency if they were not
54       *             already specified.
55       */
56      private DependencyManagement dependencyManagement;
57  
58      /**
59       * Field dependencies.
60       */
61      private java.util.List<Dependency> dependencies;
62  
63      /**
64       * Field repositories.
65       */
66      private java.util.List<Repository> repositories;
67  
68      /**
69       * Field pluginRepositories.
70       */
71      private java.util.List<Repository> pluginRepositories;
72  
73      /**
74       * 
75       *             
76       *             <b>Deprecated</b>. Now ignored by Maven.
77       *             
78       *           
79       */
80      private Object reports;
81  
82      /**
83       * 
84       *             
85       *             This element includes the specification of
86       * report plugins to use
87       *             to generate the reports on the Maven-generated
88       * site.
89       *             These reports will be run when a user executes
90       * <code>mvn site</code>.
91       *             All of the reports will be included in the
92       * navigation bar for browsing.
93       *             
94       *           
95       */
96      private Reporting reporting;
97  
98      /**
99       * Field locations.
100      */
101     private java.util.Map<Object, InputLocation> locations;
102 
103 
104       //-----------/
105      //- Methods -/
106     //-----------/
107 
108     /**
109      * Method addDependency.
110      * 
111      * @param dependency
112      */
113     public void addDependency( Dependency dependency )
114     {
115         getDependencies().add( dependency );
116     } //-- void addDependency( Dependency )
117 
118     /**
119      * Method addModule.
120      * 
121      * @param string
122      */
123     public void addModule( String string )
124     {
125         getModules().add( string );
126     } //-- void addModule( String )
127 
128     /**
129      * Method addPluginRepository.
130      * 
131      * @param repository
132      */
133     public void addPluginRepository( Repository repository )
134     {
135         getPluginRepositories().add( repository );
136     } //-- void addPluginRepository( Repository )
137 
138     /**
139      * Method addProperty.
140      * 
141      * @param key
142      * @param value
143      */
144     public void addProperty( String key, String value )
145     {
146         getProperties().put( key, value );
147     } //-- void addProperty( String, String )
148 
149     /**
150      * Method addRepository.
151      * 
152      * @param repository
153      */
154     public void addRepository( Repository repository )
155     {
156         getRepositories().add( repository );
157     } //-- void addRepository( Repository )
158 
159     /**
160      * Method clone.
161      * 
162      * @return ModelBase
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     } //-- ModelBase clone()
241 
242     /**
243      * Method getDependencies.
244      * 
245      * @return List
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     } //-- java.util.List<Dependency> getDependencies()
256 
257     /**
258      * Get default dependency information for projects that inherit
259      * from this one. The
260      *             dependencies in this section are not immediately
261      * resolved. Instead, when a POM derived
262      *             from this one declares a dependency described by
263      * a matching groupId and artifactId, the
264      *             version and other values from this section are
265      * used for that dependency if they were not
266      *             already specified.
267      * 
268      * @return DependencyManagement
269      */
270     public DependencyManagement getDependencyManagement()
271     {
272         return this.dependencyManagement;
273     } //-- DependencyManagement getDependencyManagement()
274 
275     /**
276      * Get distribution information for a project that enables
277      * deployment of the site
278      *             and artifacts to remote web servers and
279      * repositories respectively.
280      * 
281      * @return DistributionManagement
282      */
283     public DistributionManagement getDistributionManagement()
284     {
285         return this.distributionManagement;
286     } //-- DistributionManagement getDistributionManagement()
287 
288     /**
289      * 
290      * 
291      * @param key
292      * @return InputLocation
293      */
294     public InputLocation getLocation( Object key )
295     {
296         return ( locations != null ) ? locations.get( key ) : null;
297     } //-- InputLocation getLocation( Object )
298 
299     /**
300      * Method getModules.
301      * 
302      * @return List
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     } //-- java.util.List<String> getModules()
313 
314     /**
315      * Method getPluginRepositories.
316      * 
317      * @return List
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     } //-- java.util.List<Repository> getPluginRepositories()
328 
329     /**
330      * Method getProperties.
331      * 
332      * @return Properties
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     } //-- java.util.Properties getProperties()
343 
344     /**
345      * Get this element includes the specification of report
346      * plugins to use
347      *             to generate the reports on the Maven-generated
348      * site.
349      *             These reports will be run when a user executes
350      * <code>mvn site</code>.
351      *             All of the reports will be included in the
352      * navigation bar for browsing.
353      * 
354      * @return Reporting
355      */
356     public Reporting getReporting()
357     {
358         return this.reporting;
359     } //-- Reporting getReporting()
360 
361     /**
362      * Get <b>Deprecated</b>. Now ignored by Maven.
363      * 
364      * @return Object
365      */
366     public Object getReports()
367     {
368         return this.reports;
369     } //-- Object getReports()
370 
371     /**
372      * Method getRepositories.
373      * 
374      * @return List
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     } //-- java.util.List<Repository> getRepositories()
385 
386     /**
387      * Method removeDependency.
388      * 
389      * @param dependency
390      */
391     public void removeDependency( Dependency dependency )
392     {
393         getDependencies().remove( dependency );
394     } //-- void removeDependency( Dependency )
395 
396     /**
397      * Method removeModule.
398      * 
399      * @param string
400      */
401     public void removeModule( String string )
402     {
403         getModules().remove( string );
404     } //-- void removeModule( String )
405 
406     /**
407      * Method removePluginRepository.
408      * 
409      * @param repository
410      */
411     public void removePluginRepository( Repository repository )
412     {
413         getPluginRepositories().remove( repository );
414     } //-- void removePluginRepository( Repository )
415 
416     /**
417      * Method removeRepository.
418      * 
419      * @param repository
420      */
421     public void removeRepository( Repository repository )
422     {
423         getRepositories().remove( repository );
424     } //-- void removeRepository( Repository )
425 
426     /**
427      * Set this element describes all of the dependencies
428      * associated with a
429      *             project.
430      *             These dependencies are used to construct a
431      * classpath for your
432      *             project during the build process. They are
433      * automatically downloaded from the
434      *             repositories defined in this project.
435      *             See <a
436      * href="http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html">the
437      *             dependency mechanism</a> for more information.
438      * 
439      * @param dependencies
440      */
441     public void setDependencies( java.util.List<Dependency> dependencies )
442     {
443         this.dependencies = dependencies;
444     } //-- void setDependencies( java.util.List )
445 
446     /**
447      * Set default dependency information for projects that inherit
448      * from this one. The
449      *             dependencies in this section are not immediately
450      * resolved. Instead, when a POM derived
451      *             from this one declares a dependency described by
452      * a matching groupId and artifactId, the
453      *             version and other values from this section are
454      * used for that dependency if they were not
455      *             already specified.
456      * 
457      * @param dependencyManagement
458      */
459     public void setDependencyManagement( DependencyManagement dependencyManagement )
460     {
461         this.dependencyManagement = dependencyManagement;
462     } //-- void setDependencyManagement( DependencyManagement )
463 
464     /**
465      * Set distribution information for a project that enables
466      * deployment of the site
467      *             and artifacts to remote web servers and
468      * repositories respectively.
469      * 
470      * @param distributionManagement
471      */
472     public void setDistributionManagement( DistributionManagement distributionManagement )
473     {
474         this.distributionManagement = distributionManagement;
475     } //-- void setDistributionManagement( DistributionManagement )
476 
477     /**
478      * 
479      * 
480      * @param key
481      * @param location
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     } //-- void setLocation( Object, InputLocation )
494 
495     /**
496      * Set the modules (sometimes called subprojects) to build as a
497      * part of this
498      *             project. Each module listed is a relative path
499      * to the directory containing the module.
500      *             To be consistent with the way default urls are
501      * calculated from parent, it is recommended
502      *             to have module names match artifact ids.
503      * 
504      * @param modules
505      */
506     public void setModules( java.util.List<String> modules )
507     {
508         this.modules = modules;
509     } //-- void setModules( java.util.List )
510 
511     /**
512      * Set the lists of the remote repositories for discovering
513      * plugins for builds and
514      *             reports.
515      * 
516      * @param pluginRepositories
517      */
518     public void setPluginRepositories( java.util.List<Repository> pluginRepositories )
519     {
520         this.pluginRepositories = pluginRepositories;
521     } //-- void setPluginRepositories( java.util.List )
522 
523     /**
524      * Set properties that can be used throughout the POM as a
525      * substitution, and
526      *             are used as filters in resources if enabled.
527      *             The format is
528      * <code>&lt;name&gt;value&lt;/name&gt;</code>.
529      * 
530      * @param properties
531      */
532     public void setProperties( java.util.Properties properties )
533     {
534         this.properties = properties;
535     } //-- void setProperties( java.util.Properties )
536 
537     /**
538      * Set this element includes the specification of report
539      * plugins to use
540      *             to generate the reports on the Maven-generated
541      * site.
542      *             These reports will be run when a user executes
543      * <code>mvn site</code>.
544      *             All of the reports will be included in the
545      * navigation bar for browsing.
546      * 
547      * @param reporting
548      */
549     public void setReporting( Reporting reporting )
550     {
551         this.reporting = reporting;
552     } //-- void setReporting( Reporting )
553 
554     /**
555      * Set <b>Deprecated</b>. Now ignored by Maven.
556      * 
557      * @param reports
558      */
559     public void setReports( Object reports )
560     {
561         this.reports = reports;
562     } //-- void setReports( Object )
563 
564     /**
565      * Set the lists of the remote repositories for discovering
566      * dependencies and
567      *             extensions.
568      * 
569      * @param repositories
570      */
571     public void setRepositories( java.util.List<Repository> repositories )
572     {
573         this.repositories = repositories;
574     } //-- void setRepositories( java.util.List )
575 
576 }