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