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