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