001    /*
002     =================== DO NOT EDIT THIS FILE ====================
003     Generated by Modello 1.4.1 on 2012-01-20 18:09:18,
004     any modifications will be overwritten.
005     ==============================================================
006     */
007    
008    package org.apache.maven.model;
009    
010    /**
011     * 
012     *         
013     *         Base class for the <code>Model</code> and the
014     * <code>Profile</code> objects.
015     *         
016     *       
017     * 
018     * @version $Revision$ $Date$
019     */
020    @SuppressWarnings( "all" )
021    public class ModelBase
022        implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
023    {
024    
025          //--------------------------/
026         //- Class/Member Variables -/
027        //--------------------------/
028    
029        /**
030         * Field modules.
031         */
032        private java.util.List<String> modules;
033    
034        /**
035         * Distribution information for a project that enables
036         * deployment of the site
037         *             and artifacts to remote web servers and
038         * repositories respectively.
039         */
040        private DistributionManagement distributionManagement;
041    
042        /**
043         * Field properties.
044         */
045        private java.util.Properties properties;
046    
047        /**
048         * Default dependency information for projects that inherit
049         * from this one. The
050         *             dependencies in this section are not immediately
051         * resolved. Instead, when a POM derived
052         *             from this one declares a dependency described by
053         * a matching groupId and artifactId, the
054         *             version and other values from this section are
055         * used for that dependency if they were not
056         *             already specified.
057         */
058        private DependencyManagement dependencyManagement;
059    
060        /**
061         * Field dependencies.
062         */
063        private java.util.List<Dependency> dependencies;
064    
065        /**
066         * Field repositories.
067         */
068        private java.util.List<Repository> repositories;
069    
070        /**
071         * Field pluginRepositories.
072         */
073        private java.util.List<Repository> pluginRepositories;
074    
075        /**
076         * 
077         *             
078         *             <b>Deprecated</b>. Now ignored by Maven.
079         *             
080         *           
081         */
082        private Object reports;
083    
084        /**
085         * 
086         *             
087         *             This element includes the specification of
088         * report plugins to use
089         *             to generate the reports on the Maven-generated
090         * site.
091         *             These reports will be run when a user executes
092         * <code>mvn site</code>.
093         *             All of the reports will be included in the
094         * navigation bar for browsing.
095         *             
096         *           
097         */
098        private Reporting reporting;
099    
100        /**
101         * Field locations.
102         */
103        private java.util.Map<Object, InputLocation> locations;
104    
105    
106          //-----------/
107         //- Methods -/
108        //-----------/
109    
110        /**
111         * Method addDependency.
112         * 
113         * @param dependency
114         */
115        public void addDependency( Dependency dependency )
116        {
117            getDependencies().add( dependency );
118        } //-- void addDependency( Dependency )
119    
120        /**
121         * Method addModule.
122         * 
123         * @param string
124         */
125        public void addModule( String string )
126        {
127            getModules().add( string );
128        } //-- void addModule( String )
129    
130        /**
131         * Method addPluginRepository.
132         * 
133         * @param repository
134         */
135        public void addPluginRepository( Repository repository )
136        {
137            getPluginRepositories().add( repository );
138        } //-- void addPluginRepository( Repository )
139    
140        /**
141         * Method addProperty.
142         * 
143         * @param key
144         * @param value
145         */
146        public void addProperty( String key, String value )
147        {
148            getProperties().put( key, value );
149        } //-- void addProperty( String, String )
150    
151        /**
152         * Method addRepository.
153         * 
154         * @param repository
155         */
156        public void addRepository( Repository repository )
157        {
158            getRepositories().add( repository );
159        } //-- void addRepository( Repository )
160    
161        /**
162         * Method clone.
163         * 
164         * @return ModelBase
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        } //-- ModelBase clone()
243    
244        /**
245         * Method getDependencies.
246         * 
247         * @return List
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        } //-- java.util.List<Dependency> getDependencies()
258    
259        /**
260         * Get default dependency information for projects that inherit
261         * from this one. The
262         *             dependencies in this section are not immediately
263         * resolved. Instead, when a POM derived
264         *             from this one declares a dependency described by
265         * a matching groupId and artifactId, the
266         *             version and other values from this section are
267         * used for that dependency if they were not
268         *             already specified.
269         * 
270         * @return DependencyManagement
271         */
272        public DependencyManagement getDependencyManagement()
273        {
274            return this.dependencyManagement;
275        } //-- DependencyManagement getDependencyManagement()
276    
277        /**
278         * Get distribution information for a project that enables
279         * deployment of the site
280         *             and artifacts to remote web servers and
281         * repositories respectively.
282         * 
283         * @return DistributionManagement
284         */
285        public DistributionManagement getDistributionManagement()
286        {
287            return this.distributionManagement;
288        } //-- DistributionManagement getDistributionManagement()
289    
290        /**
291         * 
292         * 
293         * @param key
294         * @return InputLocation
295         */
296        public InputLocation getLocation( Object key )
297        {
298            return ( locations != null ) ? locations.get( key ) : null;
299        } //-- InputLocation getLocation( Object )
300    
301        /**
302         * Method getModules.
303         * 
304         * @return List
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        } //-- java.util.List<String> getModules()
315    
316        /**
317         * Method getPluginRepositories.
318         * 
319         * @return List
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        } //-- java.util.List<Repository> getPluginRepositories()
330    
331        /**
332         * Method getProperties.
333         * 
334         * @return Properties
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        } //-- java.util.Properties getProperties()
345    
346        /**
347         * Get this element includes the specification of report
348         * plugins to use
349         *             to generate the reports on the Maven-generated
350         * site.
351         *             These reports will be run when a user executes
352         * <code>mvn site</code>.
353         *             All of the reports will be included in the
354         * navigation bar for browsing.
355         * 
356         * @return Reporting
357         */
358        public Reporting getReporting()
359        {
360            return this.reporting;
361        } //-- Reporting getReporting()
362    
363        /**
364         * Get <b>Deprecated</b>. Now ignored by Maven.
365         * 
366         * @return Object
367         */
368        public Object getReports()
369        {
370            return this.reports;
371        } //-- Object getReports()
372    
373        /**
374         * Method getRepositories.
375         * 
376         * @return List
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        } //-- java.util.List<Repository> getRepositories()
387    
388        /**
389         * Method removeDependency.
390         * 
391         * @param dependency
392         */
393        public void removeDependency( Dependency dependency )
394        {
395            getDependencies().remove( dependency );
396        } //-- void removeDependency( Dependency )
397    
398        /**
399         * Method removeModule.
400         * 
401         * @param string
402         */
403        public void removeModule( String string )
404        {
405            getModules().remove( string );
406        } //-- void removeModule( String )
407    
408        /**
409         * Method removePluginRepository.
410         * 
411         * @param repository
412         */
413        public void removePluginRepository( Repository repository )
414        {
415            getPluginRepositories().remove( repository );
416        } //-- void removePluginRepository( Repository )
417    
418        /**
419         * Method removeRepository.
420         * 
421         * @param repository
422         */
423        public void removeRepository( Repository repository )
424        {
425            getRepositories().remove( repository );
426        } //-- void removeRepository( Repository )
427    
428        /**
429         * Set this element describes all of the dependencies
430         * associated with a
431         *             project.
432         *             These dependencies are used to construct a
433         * classpath for your
434         *             project during the build process. They are
435         * automatically downloaded from the
436         *             repositories defined in this project.
437         *             See <a
438         * href="http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html">the
439         *             dependency mechanism</a> for more information.
440         * 
441         * @param dependencies
442         */
443        public void setDependencies( java.util.List<Dependency> dependencies )
444        {
445            this.dependencies = dependencies;
446        } //-- void setDependencies( java.util.List )
447    
448        /**
449         * Set default dependency information for projects that inherit
450         * from this one. The
451         *             dependencies in this section are not immediately
452         * resolved. Instead, when a POM derived
453         *             from this one declares a dependency described by
454         * a matching groupId and artifactId, the
455         *             version and other values from this section are
456         * used for that dependency if they were not
457         *             already specified.
458         * 
459         * @param dependencyManagement
460         */
461        public void setDependencyManagement( DependencyManagement dependencyManagement )
462        {
463            this.dependencyManagement = dependencyManagement;
464        } //-- void setDependencyManagement( DependencyManagement )
465    
466        /**
467         * Set distribution information for a project that enables
468         * deployment of the site
469         *             and artifacts to remote web servers and
470         * repositories respectively.
471         * 
472         * @param distributionManagement
473         */
474        public void setDistributionManagement( DistributionManagement distributionManagement )
475        {
476            this.distributionManagement = distributionManagement;
477        } //-- void setDistributionManagement( DistributionManagement )
478    
479        /**
480         * 
481         * 
482         * @param key
483         * @param location
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        } //-- void setLocation( Object, InputLocation )
496    
497        /**
498         * Set the modules (sometimes called subprojects) to build as a
499         * part of this
500         *             project. Each module listed is a relative path
501         * to the directory containing the module.
502         * 
503         * @param modules
504         */
505        public void setModules( java.util.List<String> modules )
506        {
507            this.modules = modules;
508        } //-- void setModules( java.util.List )
509    
510        /**
511         * Set the lists of the remote repositories for discovering
512         * plugins for builds and
513         *             reports.
514         * 
515         * @param pluginRepositories
516         */
517        public void setPluginRepositories( java.util.List<Repository> pluginRepositories )
518        {
519            this.pluginRepositories = pluginRepositories;
520        } //-- void setPluginRepositories( java.util.List )
521    
522        /**
523         * Set properties that can be used throughout the POM as a
524         * substitution, and
525         *             are used as filters in resources if enabled.
526         *             The format is
527         * <code>&lt;name&gt;value&lt;/name&gt;</code>.
528         * 
529         * @param properties
530         */
531        public void setProperties( java.util.Properties properties )
532        {
533            this.properties = properties;
534        } //-- void setProperties( java.util.Properties )
535    
536        /**
537         * Set this element includes the specification of report
538         * plugins to use
539         *             to generate the reports on the Maven-generated
540         * site.
541         *             These reports will be run when a user executes
542         * <code>mvn site</code>.
543         *             All of the reports will be included in the
544         * navigation bar for browsing.
545         * 
546         * @param reporting
547         */
548        public void setReporting( Reporting reporting )
549        {
550            this.reporting = reporting;
551        } //-- void setReporting( Reporting )
552    
553        /**
554         * Set <b>Deprecated</b>. Now ignored by Maven.
555         * 
556         * @param reports
557         */
558        public void setReports( Object reports )
559        {
560            this.reports = reports;
561        } //-- void setReports( Object )
562    
563        /**
564         * Set the lists of the remote repositories for discovering
565         * dependencies and
566         *             extensions.
567         * 
568         * @param repositories
569         */
570        public void setRepositories( java.util.List<Repository> repositories )
571        {
572            this.repositories = repositories;
573        } //-- void setRepositories( java.util.List )
574    
575    }