View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   // Generated by Modello 1.8.1,
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        //-----------/
79       //- Methods -/
80      //-----------/
81  
82      /**
83       * Method clone.
84       * 
85       * @return Activation
86       */
87      public Activation clone()
88      {
89          try
90          {
91              Activation copy = (Activation) super.clone();
92  
93              if ( this.os != null )
94              {
95                  copy.os = (ActivationOS) this.os.clone();
96              }
97  
98              if ( this.property != null )
99              {
100                 copy.property = (ActivationProperty) this.property.clone();
101             }
102 
103             if ( this.file != null )
104             {
105                 copy.file = (ActivationFile) this.file.clone();
106             }
107 
108             if ( copy.locations != null )
109             {
110                 copy.locations = new java.util.LinkedHashMap( copy.locations );
111             }
112 
113             return copy;
114         }
115         catch ( java.lang.Exception ex )
116         {
117             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
118                 + " does not support clone()" ).initCause( ex );
119         }
120     } //-- Activation clone()
121 
122     /**
123      * Get specifies that this profile will be activated based on
124      * existence of a file.
125      * 
126      * @return ActivationFile
127      */
128     public ActivationFile getFile()
129     {
130         return this.file;
131     } //-- ActivationFile getFile()
132 
133     /**
134      * Get specifies that this profile will be activated when a
135      * matching JDK is detected.
136      *             For example, <code>1.4</code> only activates on
137      * JDKs versioned 1.4,
138      *             while <code>!1.4</code> matches any JDK that is
139      * not version 1.4. Ranges are supported too:
140      *             <code>[1.5,)</code> activates when the JDK is
141      * 1.5 minimum.
142      * 
143      * @return String
144      */
145     public String getJdk()
146     {
147         return this.jdk;
148     } //-- String getJdk()
149 
150     /**
151      * 
152      * 
153      * @param key
154      * @return InputLocation
155      */
156     public InputLocation getLocation( Object key )
157     {
158         return ( locations != null ) ? locations.get( key ) : null;
159     } //-- InputLocation getLocation( Object )
160 
161     /**
162      * Get specifies that this profile will be activated when
163      * matching operating system
164      *             attributes are detected.
165      * 
166      * @return ActivationOS
167      */
168     public ActivationOS getOs()
169     {
170         return this.os;
171     } //-- ActivationOS getOs()
172 
173     /**
174      * Get specifies that this profile will be activated when this
175      * system property is
176      *             specified.
177      * 
178      * @return ActivationProperty
179      */
180     public ActivationProperty getProperty()
181     {
182         return this.property;
183     } //-- ActivationProperty getProperty()
184 
185     /**
186      * Get if set to true, this profile will be active unless
187      * another profile in this
188      *             pom is activated using the command line -P
189      * option or by one of that profile's
190      *             activators.
191      * 
192      * @return boolean
193      */
194     public boolean isActiveByDefault()
195     {
196         return this.activeByDefault;
197     } //-- boolean isActiveByDefault()
198 
199     /**
200      * Set if set to true, this profile will be active unless
201      * another profile in this
202      *             pom is activated using the command line -P
203      * option or by one of that profile's
204      *             activators.
205      * 
206      * @param activeByDefault
207      */
208     public void setActiveByDefault( boolean activeByDefault )
209     {
210         this.activeByDefault = activeByDefault;
211     } //-- void setActiveByDefault( boolean )
212 
213     /**
214      * Set specifies that this profile will be activated based on
215      * existence of a file.
216      * 
217      * @param file
218      */
219     public void setFile( ActivationFile file )
220     {
221         this.file = file;
222     } //-- void setFile( ActivationFile )
223 
224     /**
225      * Set specifies that this profile will be activated when a
226      * matching JDK is detected.
227      *             For example, <code>1.4</code> only activates on
228      * JDKs versioned 1.4,
229      *             while <code>!1.4</code> matches any JDK that is
230      * not version 1.4. Ranges are supported too:
231      *             <code>[1.5,)</code> activates when the JDK is
232      * 1.5 minimum.
233      * 
234      * @param jdk
235      */
236     public void setJdk( String jdk )
237     {
238         this.jdk = jdk;
239     } //-- void setJdk( String )
240 
241     /**
242      * 
243      * 
244      * @param key
245      * @param location
246      */
247     public void setLocation( Object key, InputLocation location )
248     {
249         if ( location != null )
250         {
251             if ( this.locations == null )
252             {
253                 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
254             }
255             this.locations.put( key, location );
256         }
257     } //-- void setLocation( Object, InputLocation )
258 
259     /**
260      * Set specifies that this profile will be activated when
261      * matching operating system
262      *             attributes are detected.
263      * 
264      * @param os
265      */
266     public void setOs( ActivationOS os )
267     {
268         this.os = os;
269     } //-- void setOs( ActivationOS )
270 
271     /**
272      * Set specifies that this profile will be activated when this
273      * system property is
274      *             specified.
275      * 
276      * @param property
277      */
278     public void setProperty( ActivationProperty property )
279     {
280         this.property = property;
281     } //-- void setProperty( ActivationProperty )
282 
283 }