1
2
3
4
5
6 package org.apache.maven.model;
7
8
9
10
11
12
13
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
22
23
24
25
26
27 private java.util.List<Dependency> dependencies;
28
29
30
31
32 private java.util.Map<Object, InputLocation> locations;
33
34
35
36
37 private InputLocation location;
38
39
40
41
42 private InputLocation dependenciesLocation;
43
44
45
46
47
48
49
50
51
52
53
54 public void addDependency( Dependency dependency )
55 {
56 getDependencies().add( dependency );
57 }
58
59
60
61
62
63
64 public DependencyManagement clone()
65 {
66 try
67 {
68 DependencyManagement copy = (DependencyManagement) super.clone();
69
70 if ( this.dependencies != null )
71 {
72 copy.dependencies = new java.util.ArrayList<Dependency>();
73 for ( Dependency item : this.dependencies )
74 {
75 copy.dependencies.add( ( (Dependency) item).clone() );
76 }
77 }
78
79 if ( copy.locations != null )
80 {
81 copy.locations = new java.util.LinkedHashMap( copy.locations );
82 }
83
84 return copy;
85 }
86 catch ( java.lang.Exception ex )
87 {
88 throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
89 + " does not support clone()" ).initCause( ex );
90 }
91 }
92
93
94
95
96
97
98 public java.util.List<Dependency> getDependencies()
99 {
100 if ( this.dependencies == null )
101 {
102 this.dependencies = new java.util.ArrayList<Dependency>();
103 }
104
105 return this.dependencies;
106 }
107
108
109
110
111
112
113
114 public InputLocation getLocation( Object key )
115 {
116 if ( key instanceof String )
117 {
118 switch ( ( String ) key )
119 {
120 case "" :
121 {
122 return this.location;
123 }
124 case "dependencies" :
125 {
126 return dependenciesLocation;
127 }
128 default :
129 {
130 return getOtherLocation( key );
131 }
132 }
133 }
134 else
135 {
136 return getOtherLocation( key );
137 }
138 }
139
140
141
142
143
144
145
146 public void setLocation( Object key, InputLocation location )
147 {
148 if ( key instanceof String )
149 {
150 switch ( ( String ) key )
151 {
152 case "" :
153 {
154 this.location = location;
155 return;
156 }
157 case "dependencies" :
158 {
159 dependenciesLocation = location;
160 return;
161 }
162 default :
163 {
164 setOtherLocation( key, location );
165 return;
166 }
167 }
168 }
169 else
170 {
171 setOtherLocation( key, location );
172 }
173 }
174
175
176
177
178
179
180
181 public void setOtherLocation( Object key, InputLocation location )
182 {
183 if ( location != null )
184 {
185 if ( this.locations == null )
186 {
187 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
188 }
189 this.locations.put( key, location );
190 }
191 }
192
193
194
195
196
197
198
199 private InputLocation getOtherLocation( Object key )
200 {
201 return ( locations != null ) ? locations.get( key ) : null;
202 }
203
204
205
206
207
208
209 public void removeDependency( Dependency dependency )
210 {
211 getDependencies().remove( dependency );
212 }
213
214
215
216
217
218
219
220
221
222
223 public void setDependencies( java.util.List<Dependency> dependencies )
224 {
225 this.dependencies = dependencies;
226 }
227
228 }