View Javadoc
1   /*
2    Licensed to the Apache Software Foundation (ASF) under one
3    or more contributor license agreements.  See the NOTICE file
4    distributed with this work for additional information
5    regarding copyright ownership.  The ASF licenses this file
6    to you under the Apache License, Version 2.0 (the
7    "License"); you may not use this file except in compliance
8    with the License.  You may obtain a copy of the License at
9    
10       http://www.apache.org/licenses/LICENSE-2.0
11   
12   Unless required by applicable law or agreed to in writing,
13   software distributed under the License is distributed on an
14   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   KIND, either express or implied.  See the License for the
16   specific language governing permissions and limitations
17   under the License.
18   =================== DO NOT EDIT THIS FILE ====================
19   Generated by Modello 2.4.0,
20   any modifications will be overwritten.
21   ==============================================================
22   */
23  
24  package org.apache.maven.model;
25  
26  /**
27   * This is an activator which will detect an operating system's
28   * attributes in order
29   *         to activate its profile.
30   * 
31   * @version $Revision$ $Date$
32   */
33  @SuppressWarnings( "all" )
34  public class ActivationOS
35      implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
36  {
37  
38        //--------------------------/
39       //- Class/Member Variables -/
40      //--------------------------/
41  
42      /**
43       * 
44       *             
45       *             The name of the operating system to be used to
46       * activate the profile. This must be an exact match
47       *             of the <code>${os.name}</code> Java property,
48       * such as <code>Windows XP</code>.
49       *             
50       *           
51       */
52      private String name;
53  
54      /**
55       * 
56       *             
57       *             The general family of the OS to be used to
58       * activate the profile, such as
59       *             <code>windows</code> or <code>unix</code>.
60       *             
61       *           
62       */
63      private String family;
64  
65      /**
66       * The architecture of the operating system to be used to
67       * activate the
68       *           profile.
69       */
70      private String arch;
71  
72      /**
73       * The version of the operating system to be used to activate
74       * the
75       *           profile.
76       */
77      private String version;
78  
79      /**
80       * Field locations.
81       */
82      private java.util.Map<Object, InputLocation> locations;
83  
84      /**
85       * Field location.
86       */
87      private InputLocation location;
88  
89      /**
90       * Field nameLocation.
91       */
92      private InputLocation nameLocation;
93  
94      /**
95       * Field familyLocation.
96       */
97      private InputLocation familyLocation;
98  
99      /**
100      * Field archLocation.
101      */
102     private InputLocation archLocation;
103 
104     /**
105      * Field versionLocation.
106      */
107     private InputLocation versionLocation;
108 
109 
110       //-----------/
111      //- Methods -/
112     //-----------/
113 
114     /**
115      * Method clone.
116      * 
117      * @return ActivationOS
118      */
119     public ActivationOS clone()
120     {
121         try
122         {
123             ActivationOS copy = (ActivationOS) super.clone();
124 
125             if ( copy.locations != null )
126             {
127                 copy.locations = new java.util.LinkedHashMap( copy.locations );
128             }
129 
130             return copy;
131         }
132         catch ( java.lang.Exception ex )
133         {
134             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
135                 + " does not support clone()" ).initCause( ex );
136         }
137     } //-- ActivationOS clone()
138 
139     /**
140      * Get the architecture of the operating system to be used to
141      * activate the
142      *           profile.
143      * 
144      * @return String
145      */
146     public String getArch()
147     {
148         return this.arch;
149     } //-- String getArch()
150 
151     /**
152      * Get the general family of the OS to be used to activate the
153      * profile, such as
154      *             <code>windows</code> or <code>unix</code>.
155      * 
156      * @return String
157      */
158     public String getFamily()
159     {
160         return this.family;
161     } //-- String getFamily()
162 
163     /**
164      * 
165      * 
166      * @param key a key object.
167      * @return InputLocation
168      */
169     public InputLocation getLocation( Object key )
170     {
171         if ( key instanceof String )
172         {
173             switch ( ( String ) key )
174             {
175                 case "" :
176                 {
177                     return this.location;
178                 }
179                 case "name" :
180                 {
181                     return nameLocation;
182                 }
183                 case "family" :
184                 {
185                     return familyLocation;
186                 }
187                 case "arch" :
188                 {
189                     return archLocation;
190                 }
191                 case "version" :
192                 {
193                     return versionLocation;
194                 }
195                 default :
196                 {
197                     return getOtherLocation( key );
198                 }
199                 }
200             }
201             else
202             {
203                 return getOtherLocation( key );
204             }
205     } //-- InputLocation getLocation( Object )
206 
207     /**
208      * Get the name of the operating system to be used to activate
209      * the profile. This must be an exact match
210      *             of the <code>${os.name}</code> Java property,
211      * such as <code>Windows XP</code>.
212      * 
213      * @return String
214      */
215     public String getName()
216     {
217         return this.name;
218     } //-- String getName()
219 
220     /**
221      * 
222      * 
223      * @param key a key object.
224      * @param location a location object.
225      */
226     public void setLocation( Object key, InputLocation location )
227     {
228         if ( key instanceof String )
229         {
230             switch ( ( String ) key )
231             {
232                 case "" :
233                 {
234                     this.location = location;
235                     return;
236                 }
237                 case "name" :
238                 {
239                     nameLocation = location;
240                     return;
241                 }
242                 case "family" :
243                 {
244                     familyLocation = location;
245                     return;
246                 }
247                 case "arch" :
248                 {
249                     archLocation = location;
250                     return;
251                 }
252                 case "version" :
253                 {
254                     versionLocation = location;
255                     return;
256                 }
257                 default :
258                 {
259                     setOtherLocation( key, location );
260                     return;
261                 }
262             }
263         }
264         else
265         {
266             setOtherLocation( key, location );
267         }
268     } //-- void setLocation( Object, InputLocation )
269 
270     /**
271      * 
272      * 
273      * @param key a key object.
274      * @param location a location object.
275      */
276     public void setOtherLocation( Object key, InputLocation location )
277     {
278         if ( location != null )
279         {
280             if ( this.locations == null )
281             {
282                 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
283             }
284             this.locations.put( key, location );
285         }
286     } //-- void setOtherLocation( Object, InputLocation )
287 
288     /**
289      * 
290      * 
291      * @param key a key object.
292      * @return InputLocation
293      */
294     private InputLocation getOtherLocation( Object key )
295     {
296         return ( locations != null ) ? locations.get( key ) : null;
297     } //-- InputLocation getOtherLocation( Object )
298 
299     /**
300      * Get the version of the operating system to be used to
301      * activate the
302      *           profile.
303      * 
304      * @return String
305      */
306     public String getVersion()
307     {
308         return this.version;
309     } //-- String getVersion()
310 
311     /**
312      * Set the architecture of the operating system to be used to
313      * activate the
314      *           profile.
315      * 
316      * @param arch a arch object.
317      */
318     public void setArch( String arch )
319     {
320         this.arch = arch;
321     } //-- void setArch( String )
322 
323     /**
324      * Set the general family of the OS to be used to activate the
325      * profile, such as
326      *             <code>windows</code> or <code>unix</code>.
327      * 
328      * @param family a family object.
329      */
330     public void setFamily( String family )
331     {
332         this.family = family;
333     } //-- void setFamily( String )
334 
335     /**
336      * Set the name of the operating system to be used to activate
337      * the profile. This must be an exact match
338      *             of the <code>${os.name}</code> Java property,
339      * such as <code>Windows XP</code>.
340      * 
341      * @param name a name object.
342      */
343     public void setName( String name )
344     {
345         this.name = name;
346     } //-- void setName( String )
347 
348     /**
349      * Set the version of the operating system to be used to
350      * activate the
351      *           profile.
352      * 
353      * @param version a version object.
354      */
355     public void setVersion( String version )
356     {
357         this.version = version;
358     } //-- void setVersion( String )
359 
360 }