1   
2   
3   
4   
5   
6   
7   
8   package org.apache.maven.model;
9   
10  
11  
12  
13  
14  
15  
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       
24      
25  
26      
27  
28  
29      private java.util.List<Dependency> dependencies;
30  
31      
32  
33  
34      private java.util.Map<Object, InputLocation> locations;
35  
36  
37        
38       
39      
40  
41      
42  
43  
44  
45  
46      public void addDependency( Dependency dependency )
47      {
48          getDependencies().add( dependency );
49      } 
50  
51      
52  
53  
54  
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      } 
84  
85      
86  
87  
88  
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      } 
99  
100     
101 
102 
103 
104 
105 
106     public InputLocation getLocation( Object key )
107     {
108         return ( locations != null ) ? locations.get( key ) : null;
109     } 
110 
111     
112 
113 
114 
115 
116     public void removeDependency( Dependency dependency )
117     {
118         getDependencies().remove( dependency );
119     } 
120 
121     
122 
123 
124 
125 
126 
127 
128 
129 
130     public void setDependencies( java.util.List<Dependency> dependencies )
131     {
132         this.dependencies = dependencies;
133     } 
134 
135     
136 
137 
138 
139 
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     } 
152 
153 }