View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   // Generated by Modello 1.11,
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$ $Date$
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      * Field location.
105      */
106     private InputLocation location;
107 
108     /**
109      * Field modulesLocation.
110      */
111     private InputLocation modulesLocation;
112 
113     /**
114      * Field distributionManagementLocation.
115      */
116     private InputLocation distributionManagementLocation;
117 
118     /**
119      * Field propertiesLocation.
120      */
121     private InputLocation propertiesLocation;
122 
123     /**
124      * Field dependencyManagementLocation.
125      */
126     private InputLocation dependencyManagementLocation;
127 
128     /**
129      * Field dependenciesLocation.
130      */
131     private InputLocation dependenciesLocation;
132 
133     /**
134      * Field repositoriesLocation.
135      */
136     private InputLocation repositoriesLocation;
137 
138     /**
139      * Field pluginRepositoriesLocation.
140      */
141     private InputLocation pluginRepositoriesLocation;
142 
143     /**
144      * Field reportsLocation.
145      */
146     private InputLocation reportsLocation;
147 
148     /**
149      * Field reportingLocation.
150      */
151     private InputLocation reportingLocation;
152 
153 
154       //-----------/
155      //- Methods -/
156     //-----------/
157 
158     /**
159      * Method addDependency.
160      * 
161      * @param dependency
162      */
163     public void addDependency( Dependency dependency )
164     {
165         getDependencies().add( dependency );
166     } //-- void addDependency( Dependency )
167 
168     /**
169      * Method addModule.
170      * 
171      * @param string
172      */
173     public void addModule( String string )
174     {
175         getModules().add( string );
176     } //-- void addModule( String )
177 
178     /**
179      * Method addPluginRepository.
180      * 
181      * @param repository
182      */
183     public void addPluginRepository( Repository repository )
184     {
185         getPluginRepositories().add( repository );
186     } //-- void addPluginRepository( Repository )
187 
188     /**
189      * Method addProperty.
190      * 
191      * @param key
192      * @param value
193      */
194     public void addProperty( String key, String value )
195     {
196         getProperties().put( key, value );
197     } //-- void addProperty( String, String )
198 
199     /**
200      * Method addRepository.
201      * 
202      * @param repository
203      */
204     public void addRepository( Repository repository )
205     {
206         getRepositories().add( repository );
207     } //-- void addRepository( Repository )
208 
209     /**
210      * Method clone.
211      * 
212      * @return ModelBase
213      */
214     public ModelBase clone()
215     {
216         try
217         {
218             ModelBase copy = (ModelBase) super.clone();
219 
220             if ( this.modules != null )
221             {
222                 copy.modules = new java.util.ArrayList<String>();
223                 copy.modules.addAll( this.modules );
224             }
225 
226             if ( this.distributionManagement != null )
227             {
228                 copy.distributionManagement = (DistributionManagement) this.distributionManagement.clone();
229             }
230 
231             if ( this.properties != null )
232             {
233                 copy.properties = (java.util.Properties) this.properties.clone();
234             }
235 
236             if ( this.dependencyManagement != null )
237             {
238                 copy.dependencyManagement = (DependencyManagement) this.dependencyManagement.clone();
239             }
240 
241             if ( this.dependencies != null )
242             {
243                 copy.dependencies = new java.util.ArrayList<Dependency>();
244                 for ( Dependency item : this.dependencies )
245                 {
246                     copy.dependencies.add( ( (Dependency) item).clone() );
247                 }
248             }
249 
250             if ( this.repositories != null )
251             {
252                 copy.repositories = new java.util.ArrayList<Repository>();
253                 for ( Repository item : this.repositories )
254                 {
255                     copy.repositories.add( ( (Repository) item).clone() );
256                 }
257             }
258 
259             if ( this.pluginRepositories != null )
260             {
261                 copy.pluginRepositories = new java.util.ArrayList<Repository>();
262                 for ( Repository item : this.pluginRepositories )
263                 {
264                     copy.pluginRepositories.add( ( (Repository) item).clone() );
265                 }
266             }
267 
268             if ( this.reports != null )
269             {
270                 copy.reports = new org.codehaus.plexus.util.xml.Xpp3Dom( (org.codehaus.plexus.util.xml.Xpp3Dom) this.reports );
271             }
272 
273             if ( this.reporting != null )
274             {
275                 copy.reporting = (Reporting) this.reporting.clone();
276             }
277 
278             if ( copy.locations != null )
279             {
280                 copy.locations = new java.util.LinkedHashMap( copy.locations );
281             }
282 
283             return copy;
284         }
285         catch ( java.lang.Exception ex )
286         {
287             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
288                 + " does not support clone()" ).initCause( ex );
289         }
290     } //-- ModelBase clone()
291 
292     /**
293      * Method getDependencies.
294      * 
295      * @return List
296      */
297     public java.util.List<Dependency> getDependencies()
298     {
299         if ( this.dependencies == null )
300         {
301             this.dependencies = new java.util.ArrayList<Dependency>();
302         }
303 
304         return this.dependencies;
305     } //-- java.util.List<Dependency> getDependencies()
306 
307     /**
308      * Get default dependency information for projects that inherit
309      * from this one. The
310      *             dependencies in this section are not immediately
311      * resolved. Instead, when a POM derived
312      *             from this one declares a dependency described by
313      * a matching groupId and artifactId, the
314      *             version and other values from this section are
315      * used for that dependency if they were not
316      *             already specified.
317      * 
318      * @return DependencyManagement
319      */
320     public DependencyManagement getDependencyManagement()
321     {
322         return this.dependencyManagement;
323     } //-- DependencyManagement getDependencyManagement()
324 
325     /**
326      * Get distribution information for a project that enables
327      * deployment of the site
328      *             and artifacts to remote web servers and
329      * repositories respectively.
330      * 
331      * @return DistributionManagement
332      */
333     public DistributionManagement getDistributionManagement()
334     {
335         return this.distributionManagement;
336     } //-- DistributionManagement getDistributionManagement()
337 
338     /**
339      * 
340      * 
341      * @param key
342      * @return InputLocation
343      */
344     public InputLocation getLocation( Object key )
345     {
346         if ( key instanceof String )
347         {
348             switch ( ( String ) key )
349             {
350                 case "" :
351                 {
352                     return this.location;
353                 }
354                 case "modules" :
355                 {
356                     return modulesLocation;
357                 }
358                 case "distributionManagement" :
359                 {
360                     return distributionManagementLocation;
361                 }
362                 case "properties" :
363                 {
364                     return propertiesLocation;
365                 }
366                 case "dependencyManagement" :
367                 {
368                     return dependencyManagementLocation;
369                 }
370                 case "dependencies" :
371                 {
372                     return dependenciesLocation;
373                 }
374                 case "repositories" :
375                 {
376                     return repositoriesLocation;
377                 }
378                 case "pluginRepositories" :
379                 {
380                     return pluginRepositoriesLocation;
381                 }
382                 case "reports" :
383                 {
384                     return reportsLocation;
385                 }
386                 case "reporting" :
387                 {
388                     return reportingLocation;
389                 }
390                 default :
391                 {
392                     return getOtherLocation( key );
393                 }
394                 }
395             }
396             else
397             {
398                 return getOtherLocation( key );
399             }
400     } //-- InputLocation getLocation( Object )
401 
402     /**
403      * Method getModules.
404      * 
405      * @return List
406      */
407     public java.util.List<String> getModules()
408     {
409         if ( this.modules == null )
410         {
411             this.modules = new java.util.ArrayList<String>();
412         }
413 
414         return this.modules;
415     } //-- java.util.List<String> getModules()
416 
417     /**
418      * 
419      * 
420      * @param key
421      * @param location
422      */
423     public void setLocation( Object key, InputLocation location )
424     {
425         if ( key instanceof String )
426         {
427             switch ( ( String ) key )
428             {
429                 case "" :
430                 {
431                     this.location = location;
432                     return;
433                 }
434                 case "modules" :
435                 {
436                     modulesLocation = location;
437                     return;
438                 }
439                 case "distributionManagement" :
440                 {
441                     distributionManagementLocation = location;
442                     return;
443                 }
444                 case "properties" :
445                 {
446                     propertiesLocation = location;
447                     return;
448                 }
449                 case "dependencyManagement" :
450                 {
451                     dependencyManagementLocation = location;
452                     return;
453                 }
454                 case "dependencies" :
455                 {
456                     dependenciesLocation = location;
457                     return;
458                 }
459                 case "repositories" :
460                 {
461                     repositoriesLocation = location;
462                     return;
463                 }
464                 case "pluginRepositories" :
465                 {
466                     pluginRepositoriesLocation = location;
467                     return;
468                 }
469                 case "reports" :
470                 {
471                     reportsLocation = location;
472                     return;
473                 }
474                 case "reporting" :
475                 {
476                     reportingLocation = location;
477                     return;
478                 }
479                 default :
480                 {
481                     setOtherLocation( key, location );
482                     return;
483                 }
484                 }
485             }
486             else
487             {
488                 setOtherLocation( key, location );
489             }
490     } //-- void setLocation( Object, InputLocation )
491 
492     /**
493      * 
494      * 
495      * @param key
496      * @param location
497      */
498     public void setOtherLocation( Object key, InputLocation location )
499     {
500         if ( location != null )
501         {
502             if ( this.locations == null )
503             {
504                 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
505             }
506             this.locations.put( key, location );
507         }
508     } //-- void setOtherLocation( Object, InputLocation )
509 
510     /**
511      * 
512      * 
513      * @param key
514      * @return InputLocation
515      */
516     private InputLocation getOtherLocation( Object key )
517     {
518         return ( locations != null ) ? locations.get( key ) : null;
519     } //-- InputLocation getOtherLocation( Object )
520 
521     /**
522      * Method getPluginRepositories.
523      * 
524      * @return List
525      */
526     public java.util.List<Repository> getPluginRepositories()
527     {
528         if ( this.pluginRepositories == null )
529         {
530             this.pluginRepositories = new java.util.ArrayList<Repository>();
531         }
532 
533         return this.pluginRepositories;
534     } //-- java.util.List<Repository> getPluginRepositories()
535 
536     /**
537      * Method getProperties.
538      * 
539      * @return Properties
540      */
541     public java.util.Properties getProperties()
542     {
543         if ( this.properties == null )
544         {
545             this.properties = new java.util.Properties();
546         }
547 
548         return this.properties;
549     } //-- java.util.Properties getProperties()
550 
551     /**
552      * Get this element includes the specification of report
553      * plugins to use
554      *             to generate the reports on the Maven-generated
555      * site.
556      *             These reports will be run when a user executes
557      * <code>mvn site</code>.
558      *             All of the reports will be included in the
559      * navigation bar for browsing.
560      * 
561      * @return Reporting
562      */
563     public Reporting getReporting()
564     {
565         return this.reporting;
566     } //-- Reporting getReporting()
567 
568     /**
569      * Get <b>Deprecated</b>. Now ignored by Maven.
570      * 
571      * @return Object
572      */
573     public Object getReports()
574     {
575         return this.reports;
576     } //-- Object getReports()
577 
578     /**
579      * Method getRepositories.
580      * 
581      * @return List
582      */
583     public java.util.List<Repository> getRepositories()
584     {
585         if ( this.repositories == null )
586         {
587             this.repositories = new java.util.ArrayList<Repository>();
588         }
589 
590         return this.repositories;
591     } //-- java.util.List<Repository> getRepositories()
592 
593     /**
594      * Method removeDependency.
595      * 
596      * @param dependency
597      */
598     public void removeDependency( Dependency dependency )
599     {
600         getDependencies().remove( dependency );
601     } //-- void removeDependency( Dependency )
602 
603     /**
604      * Method removeModule.
605      * 
606      * @param string
607      */
608     public void removeModule( String string )
609     {
610         getModules().remove( string );
611     } //-- void removeModule( String )
612 
613     /**
614      * Method removePluginRepository.
615      * 
616      * @param repository
617      */
618     public void removePluginRepository( Repository repository )
619     {
620         getPluginRepositories().remove( repository );
621     } //-- void removePluginRepository( Repository )
622 
623     /**
624      * Method removeRepository.
625      * 
626      * @param repository
627      */
628     public void removeRepository( Repository repository )
629     {
630         getRepositories().remove( repository );
631     } //-- void removeRepository( Repository )
632 
633     /**
634      * Set this element describes all of the dependencies
635      * associated with a
636      *             project.
637      *             These dependencies are used to construct a
638      * classpath for your
639      *             project during the build process. They are
640      * automatically downloaded from the
641      *             repositories defined in this project.
642      *             See <a
643      * href="https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html">the
644      *             dependency mechanism</a> for more information.
645      * 
646      * @param dependencies
647      */
648     public void setDependencies( java.util.List<Dependency> dependencies )
649     {
650         this.dependencies = dependencies;
651     } //-- void setDependencies( java.util.List )
652 
653     /**
654      * Set default dependency information for projects that inherit
655      * from this one. The
656      *             dependencies in this section are not immediately
657      * resolved. Instead, when a POM derived
658      *             from this one declares a dependency described by
659      * a matching groupId and artifactId, the
660      *             version and other values from this section are
661      * used for that dependency if they were not
662      *             already specified.
663      * 
664      * @param dependencyManagement
665      */
666     public void setDependencyManagement( DependencyManagement dependencyManagement )
667     {
668         this.dependencyManagement = dependencyManagement;
669     } //-- void setDependencyManagement( DependencyManagement )
670 
671     /**
672      * Set distribution information for a project that enables
673      * deployment of the site
674      *             and artifacts to remote web servers and
675      * repositories respectively.
676      * 
677      * @param distributionManagement
678      */
679     public void setDistributionManagement( DistributionManagement distributionManagement )
680     {
681         this.distributionManagement = distributionManagement;
682     } //-- void setDistributionManagement( DistributionManagement )
683 
684     /**
685      * Set the modules (sometimes called subprojects) to build as a
686      * part of this
687      *             project. Each module listed is a relative path
688      * to the directory containing the module.
689      *             To be consistent with the way default urls are
690      * calculated from parent, it is recommended
691      *             to have module names match artifact ids.
692      * 
693      * @param modules
694      */
695     public void setModules( java.util.List<String> modules )
696     {
697         this.modules = modules;
698     } //-- void setModules( java.util.List )
699 
700     /**
701      * Set the lists of the remote repositories for discovering
702      * plugins for builds and
703      *             reports.
704      * 
705      * @param pluginRepositories
706      */
707     public void setPluginRepositories( java.util.List<Repository> pluginRepositories )
708     {
709         this.pluginRepositories = pluginRepositories;
710     } //-- void setPluginRepositories( java.util.List )
711 
712     /**
713      * Set properties that can be used throughout the POM as a
714      * substitution, and
715      *             are used as filters in resources if enabled.
716      *             The format is
717      * <code>&lt;name&gt;value&lt;/name&gt;</code>.
718      * 
719      * @param properties
720      */
721     public void setProperties( java.util.Properties properties )
722     {
723         this.properties = properties;
724     } //-- void setProperties( java.util.Properties )
725 
726     /**
727      * Set this element includes the specification of report
728      * plugins to use
729      *             to generate the reports on the Maven-generated
730      * site.
731      *             These reports will be run when a user executes
732      * <code>mvn site</code>.
733      *             All of the reports will be included in the
734      * navigation bar for browsing.
735      * 
736      * @param reporting
737      */
738     public void setReporting( Reporting reporting )
739     {
740         this.reporting = reporting;
741     } //-- void setReporting( Reporting )
742 
743     /**
744      * Set <b>Deprecated</b>. Now ignored by Maven.
745      * 
746      * @param reports
747      */
748     public void setReports( Object reports )
749     {
750         this.reports = reports;
751     } //-- void setReports( Object )
752 
753     /**
754      * Set the lists of the remote repositories for discovering
755      * dependencies and
756      *             extensions.
757      * 
758      * @param repositories
759      */
760     public void setRepositories( java.util.List<Repository> repositories )
761     {
762         this.repositories = repositories;
763     } //-- void setRepositories( java.util.List )
764 
765 }