1   
2   
3   
4   
5   
6   package org.apache.maven.model;
7   
8   
9   
10  
11  
12  
13  @SuppressWarnings( "all" )
14  public class Prerequisites
15      implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
16  {
17  
18        
19       
20      
21  
22      
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39      private String maven = "2.0";
40  
41      
42  
43  
44      private java.util.Map<Object, InputLocation> locations;
45  
46      
47  
48  
49      private InputLocation location;
50  
51      
52  
53  
54      private InputLocation mavenLocation;
55  
56  
57        
58       
59      
60  
61      
62  
63  
64  
65  
66      public Prerequisites clone()
67      {
68          try
69          {
70              Prerequisites copy = (Prerequisites) super.clone();
71  
72              if ( copy.locations != null )
73              {
74                  copy.locations = new java.util.LinkedHashMap( copy.locations );
75              }
76  
77              return copy;
78          }
79          catch ( java.lang.Exception ex )
80          {
81              throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
82                  + " does not support clone()" ).initCause( ex );
83          }
84      } 
85  
86      
87  
88  
89  
90  
91  
92      public InputLocation getLocation( Object key )
93      {
94          if ( key instanceof String )
95          {
96              switch ( ( String ) key )
97              {
98                  case "" :
99                  {
100                     return this.location;
101                 }
102                 case "maven" :
103                 {
104                     return mavenLocation;
105                 }
106                 default :
107                 {
108                     return getOtherLocation( key );
109                 }
110                 }
111             }
112             else
113             {
114                 return getOtherLocation( key );
115             }
116     } 
117 
118     
119 
120 
121 
122 
123 
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 
211 
212 
213 
214 
215 
216 
217 
218 
219     public void setMaven( String maven )
220     {
221         this.maven = maven;
222     } 
223 
224 }