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
38
39
40
41
42
43
44 public void addDependency( Dependency dependency )
45 {
46 getDependencies().add( dependency );
47 }
48
49
50
51
52
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 }
82
83
84
85
86
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 }
97
98
99
100
101
102
103
104 public InputLocation getLocation( Object key )
105 {
106 return ( locations != null ) ? locations.get( key ) : null;
107 }
108
109
110
111
112
113
114 public void removeDependency( Dependency dependency )
115 {
116 getDependencies().remove( dependency );
117 }
118
119
120
121
122
123
124
125
126
127
128 public void setDependencies( java.util.List<Dependency> dependencies )
129 {
130 this.dependencies = dependencies;
131 }
132
133
134
135
136
137
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 }
150
151 }