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    * The conditions within the build runtime environment which will
10   * trigger the
11   *         automatic inclusion of the build profile. Multiple
12   * conditions can be defined, which must
13   *         be all satisfied to activate the profile.
14   *       
15   * 
16   * @version $Revision$ $Date$
17   */
18  @SuppressWarnings( "all" )
19  public class Activation
20      implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
21  {
22  
23        //--------------------------/
24       //- Class/Member Variables -/
25      //--------------------------/
26  
27      /**
28       * If set to true, this profile will be active unless another
29       * profile in this
30       *             pom is activated using the command line -P
31       * option or by one of that profile's
32       *             activators.
33       */
34      private boolean activeByDefault = false;
35  
36      /**
37       * 
38       *             
39       *             Specifies that this profile will be activated
40       * when a matching JDK is detected.
41       *             For example, <code>1.4</code> only activates on
42       * JDKs versioned 1.4,
43       *             while <code>!1.4</code> matches any JDK that is
44       * not version 1.4. Ranges are supported too:
45       *             <code>[1.5,)</code> activates when the JDK is
46       * 1.5 minimum.
47       *             
48       *           
49       */
50      private String jdk;
51  
52      /**
53       * Specifies that this profile will be activated when matching
54       * operating system
55       *             attributes are detected.
56       */
57      private ActivationOS os;
58  
59      /**
60       * Specifies that this profile will be activated when this
61       * system property is
62       *             specified.
63       */
64      private ActivationProperty property;
65  
66      /**
67       * Specifies that this profile will be activated based on
68       * existence of a file.
69       */
70      private ActivationFile file;
71  
72      /**
73       * Field locations.
74       */
75      private java.util.Map<Object, InputLocation> locations;
76  
77      /**
78       * Field location.
79       */
80      private InputLocation location;
81  
82      /**
83       * Field activeByDefaultLocation.
84       */
85      private InputLocation activeByDefaultLocation;
86  
87      /**
88       * Field jdkLocation.
89       */
90      private InputLocation jdkLocation;
91  
92      /**
93       * Field osLocation.
94       */
95      private InputLocation osLocation;
96  
97      /**
98       * Field propertyLocation.
99       */
100     private InputLocation propertyLocation;
101 
102     /**
103      * Field fileLocation.
104      */
105     private InputLocation fileLocation;
106 
107 
108       //-----------/
109      //- Methods -/
110     //-----------/
111 
112     /**
113      * Method clone.
114      * 
115      * @return Activation
116      */
117     public Activation clone()
118     {
119         try
120         {
121             Activation copy = (Activation) super.clone();
122 
123             if ( this.os != null )
124             {
125                 copy.os = (ActivationOS) this.os.clone();
126             }
127 
128             if ( this.property != null )
129             {
130                 copy.property = (ActivationProperty) this.property.clone();
131             }
132 
133             if ( this.file != null )
134             {
135                 copy.file = (ActivationFile) this.file.clone();
136             }
137 
138             if ( copy.locations != null )
139             {
140                 copy.locations = new java.util.LinkedHashMap( copy.locations );
141             }
142 
143             return copy;
144         }
145         catch ( java.lang.Exception ex )
146         {
147             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
148                 + " does not support clone()" ).initCause( ex );
149         }
150     } //-- Activation clone()
151 
152     /**
153      * Get specifies that this profile will be activated based on
154      * existence of a file.
155      * 
156      * @return ActivationFile
157      */
158     public ActivationFile getFile()
159     {
160         return this.file;
161     } //-- ActivationFile getFile()
162 
163     /**
164      * Get specifies that this profile will be activated when a
165      * matching JDK is detected.
166      *             For example, <code>1.4</code> only activates on
167      * JDKs versioned 1.4,
168      *             while <code>!1.4</code> matches any JDK that is
169      * not version 1.4. Ranges are supported too:
170      *             <code>[1.5,)</code> activates when the JDK is
171      * 1.5 minimum.
172      * 
173      * @return String
174      */
175     public String getJdk()
176     {
177         return this.jdk;
178     } //-- String getJdk()
179 
180     /**
181      * 
182      * 
183      * @param key
184      * @return InputLocation
185      */
186     public InputLocation getLocation( Object key )
187     {
188         if ( key instanceof String )
189         {
190             switch ( ( String ) key )
191             {
192                 case "" :
193                 {
194                     return this.location;
195                 }
196                 case "activeByDefault" :
197                 {
198                     return activeByDefaultLocation;
199                 }
200                 case "jdk" :
201                 {
202                     return jdkLocation;
203                 }
204                 case "os" :
205                 {
206                     return osLocation;
207                 }
208                 case "property" :
209                 {
210                     return propertyLocation;
211                 }
212                 case "file" :
213                 {
214                     return fileLocation;
215                 }
216                 default :
217                 {
218                     return getOtherLocation( key );
219                 }
220                 }
221             }
222             else
223             {
224                 return getOtherLocation( key );
225             }
226     } //-- InputLocation getLocation( Object )
227 
228     /**
229      * Get specifies that this profile will be activated when
230      * matching operating system
231      *             attributes are detected.
232      * 
233      * @return ActivationOS
234      */
235     public ActivationOS getOs()
236     {
237         return this.os;
238     } //-- ActivationOS getOs()
239 
240     /**
241      * 
242      * 
243      * @param key
244      * @param location
245      */
246     public void setLocation( Object key, InputLocation location )
247     {
248         if ( key instanceof String )
249         {
250             switch ( ( String ) key )
251             {
252                 case "" :
253                 {
254                     this.location = location;
255                     return;
256                 }
257                 case "activeByDefault" :
258                 {
259                     activeByDefaultLocation = location;
260                     return;
261                 }
262                 case "jdk" :
263                 {
264                     jdkLocation = location;
265                     return;
266                 }
267                 case "os" :
268                 {
269                     osLocation = location;
270                     return;
271                 }
272                 case "property" :
273                 {
274                     propertyLocation = location;
275                     return;
276                 }
277                 case "file" :
278                 {
279                     fileLocation = location;
280                     return;
281                 }
282                 default :
283                 {
284                     setOtherLocation( key, location );
285                     return;
286                 }
287                 }
288             }
289             else
290             {
291                 setOtherLocation( key, location );
292             }
293     } //-- void setLocation( Object, InputLocation )
294 
295     /**
296      * 
297      * 
298      * @param key
299      * @param location
300      */
301     public void setOtherLocation( Object key, InputLocation location )
302     {
303         if ( location != null )
304         {
305             if ( this.locations == null )
306             {
307                 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
308             }
309             this.locations.put( key, location );
310         }
311     } //-- void setOtherLocation( Object, InputLocation )
312 
313     /**
314      * 
315      * 
316      * @param key
317      * @return InputLocation
318      */
319     private InputLocation getOtherLocation( Object key )
320     {
321         return ( locations != null ) ? locations.get( key ) : null;
322     } //-- InputLocation getOtherLocation( Object )
323 
324     /**
325      * Get specifies that this profile will be activated when this
326      * system property is
327      *             specified.
328      * 
329      * @return ActivationProperty
330      */
331     public ActivationProperty getProperty()
332     {
333         return this.property;
334     } //-- ActivationProperty getProperty()
335 
336     /**
337      * Get if set to true, this profile will be active unless
338      * another profile in this
339      *             pom is activated using the command line -P
340      * option or by one of that profile's
341      *             activators.
342      * 
343      * @return boolean
344      */
345     public boolean isActiveByDefault()
346     {
347         return this.activeByDefault;
348     } //-- boolean isActiveByDefault()
349 
350     /**
351      * Set if set to true, this profile will be active unless
352      * another profile in this
353      *             pom is activated using the command line -P
354      * option or by one of that profile's
355      *             activators.
356      * 
357      * @param activeByDefault
358      */
359     public void setActiveByDefault( boolean activeByDefault )
360     {
361         this.activeByDefault = activeByDefault;
362     } //-- void setActiveByDefault( boolean )
363 
364     /**
365      * Set specifies that this profile will be activated based on
366      * existence of a file.
367      * 
368      * @param file
369      */
370     public void setFile( ActivationFile file )
371     {
372         this.file = file;
373     } //-- void setFile( ActivationFile )
374 
375     /**
376      * Set specifies that this profile will be activated when a
377      * matching JDK is detected.
378      *             For example, <code>1.4</code> only activates on
379      * JDKs versioned 1.4,
380      *             while <code>!1.4</code> matches any JDK that is
381      * not version 1.4. Ranges are supported too:
382      *             <code>[1.5,)</code> activates when the JDK is
383      * 1.5 minimum.
384      * 
385      * @param jdk
386      */
387     public void setJdk( String jdk )
388     {
389         this.jdk = jdk;
390     } //-- void setJdk( String )
391 
392     /**
393      * Set specifies that this profile will be activated when
394      * matching operating system
395      *             attributes are detected.
396      * 
397      * @param os
398      */
399     public void setOs( ActivationOS os )
400     {
401         this.os = os;
402     } //-- void setOs( ActivationOS )
403 
404     /**
405      * Set specifies that this profile will be activated when this
406      * system property is
407      *             specified.
408      * 
409      * @param property
410      */
411     public void setProperty( ActivationProperty property )
412     {
413         this.property = property;
414     } //-- void setProperty( ActivationProperty )
415 
416 }