1
2
3
4
5
6 package org.apache.maven.model;
7
8
9
10
11
12
13
14
15
16
17
18 @SuppressWarnings( "all" )
19 public class ActivationProperty
20 implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
21 {
22
23
24
25
26
27
28
29
30 private String name;
31
32
33
34
35 private String value;
36
37
38
39
40 private java.util.Map<Object, InputLocation> locations;
41
42
43
44
45 private InputLocation location;
46
47
48
49
50 private InputLocation nameLocation;
51
52
53
54
55 private InputLocation valueLocation;
56
57
58
59
60
61
62
63
64
65
66
67 public ActivationProperty clone()
68 {
69 try
70 {
71 ActivationProperty copy = (ActivationProperty) super.clone();
72
73 if ( copy.locations != null )
74 {
75 copy.locations = new java.util.LinkedHashMap( copy.locations );
76 }
77
78 return copy;
79 }
80 catch ( java.lang.Exception ex )
81 {
82 throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
83 + " does not support clone()" ).initCause( ex );
84 }
85 }
86
87
88
89
90
91
92
93 public InputLocation getLocation( Object key )
94 {
95 if ( key instanceof String )
96 {
97 switch ( ( String ) key )
98 {
99 case "" :
100 {
101 return this.location;
102 }
103 case "name" :
104 {
105 return nameLocation;
106 }
107 case "value" :
108 {
109 return valueLocation;
110 }
111 default :
112 {
113 return getOtherLocation( key );
114 }
115 }
116 }
117 else
118 {
119 return getOtherLocation( key );
120 }
121 }
122
123
124
125
126
127
128
129 public String getName()
130 {
131 return this.name;
132 }
133
134
135
136
137
138
139
140 public void setLocation( Object key, InputLocation location )
141 {
142 if ( key instanceof String )
143 {
144 switch ( ( String ) key )
145 {
146 case "" :
147 {
148 this.location = location;
149 return;
150 }
151 case "name" :
152 {
153 nameLocation = location;
154 return;
155 }
156 case "value" :
157 {
158 valueLocation = 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 public String getValue()
210 {
211 return this.value;
212 }
213
214
215
216
217
218
219
220 public void setName( String name )
221 {
222 this.name = name;
223 }
224
225
226
227
228
229
230
231 public void setValue( String value )
232 {
233 this.value = value;
234 }
235
236 }