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    * Section for management of default dependency information for use
10   * in a group of
11   *         POMs.
12   * 
13   * @version $Revision: 965443 $ $Date: 2015-09-15 00:18:52 +0200 (Tue, 15 Sep 2015) $
14   */
15  @SuppressWarnings( "all" )
16  public class DependencyManagement
17      implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
18  {
19  
20        //--------------------------/
21       //- Class/Member Variables -/
22      //--------------------------/
23  
24      /**
25       * Field dependencies.
26       */
27      private java.util.List<Dependency> dependencies;
28  
29      /**
30       * Field locations.
31       */
32      private java.util.Map<Object, InputLocation> locations;
33  
34  
35        //-----------/
36       //- Methods -/
37      //-----------/
38  
39      /**
40       * Method addDependency.
41       * 
42       * @param dependency
43       */
44      public void addDependency( Dependency dependency )
45      {
46          getDependencies().add( dependency );
47      } //-- void addDependency( Dependency )
48  
49      /**
50       * Method clone.
51       * 
52       * @return DependencyManagement
53       */
54      public DependencyManagement clone()
55      {
56          try
57          {
58              DependencyManagement copy = (DependencyManagement) super.clone();
59  
60              if ( this.dependencies != null )
61              {
62                  copy.dependencies = new java.util.ArrayList<Dependency>();
63                  for ( Dependency item : this.dependencies )
64                  {
65                      copy.dependencies.add( ( (Dependency) item).clone() );
66                  }
67              }
68  
69              if ( copy.locations != null )
70              {
71                  copy.locations = new java.util.LinkedHashMap( copy.locations );
72              }
73  
74              return copy;
75          }
76          catch ( java.lang.Exception ex )
77          {
78              throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
79                  + " does not support clone()" ).initCause( ex );
80          }
81      } //-- DependencyManagement clone()
82  
83      /**
84       * Method getDependencies.
85       * 
86       * @return List
87       */
88      public java.util.List<Dependency> getDependencies()
89      {
90          if ( this.dependencies == null )
91          {
92              this.dependencies = new java.util.ArrayList<Dependency>();
93          }
94  
95          return this.dependencies;
96      } //-- java.util.List<Dependency> getDependencies()
97  
98      /**
99       * 
100      * 
101      * @param key
102      * @return InputLocation
103      */
104     public InputLocation getLocation( Object key )
105     {
106         return ( locations != null ) ? locations.get( key ) : null;
107     } //-- InputLocation getLocation( Object )
108 
109     /**
110      * Method removeDependency.
111      * 
112      * @param dependency
113      */
114     public void removeDependency( Dependency dependency )
115     {
116         getDependencies().remove( dependency );
117     } //-- void removeDependency( Dependency )
118 
119     /**
120      * Set the dependencies specified here are not used until they
121      * are referenced in a
122      *             POM within the group. This allows the
123      * specification of a "standard" version for a
124      *             particular dependency.
125      * 
126      * @param dependencies
127      */
128     public void setDependencies( java.util.List<Dependency> dependencies )
129     {
130         this.dependencies = dependencies;
131     } //-- void setDependencies( java.util.List )
132 
133     /**
134      * 
135      * 
136      * @param key
137      * @param location
138      */
139     public void setLocation( Object key, InputLocation location )
140     {
141         if ( location != null )
142         {
143             if ( this.locations == null )
144             {
145                 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
146             }
147             this.locations.put( key, location );
148         }
149     } //-- void setLocation( Object, InputLocation )
150 
151 }