View Javadoc

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