View Javadoc

1   /*
2    * $Id$
3    */
4   
5   package org.apache.maven.settings;
6   
7     //---------------------------------/
8    //- Imported classes and packages -/
9   //---------------------------------/
10  
11  import java.util.Date;
12  
13  /**
14   * 
15   *         
16   *         The conditions within the build runtime environment
17   * which will trigger
18   *         the automatic inclusion of the parent build profile.
19   *         
20   *       
21   * 
22   * @version $Revision$ $Date$
23   */
24  public class Activation implements java.io.Serializable {
25  
26  
27        //--------------------------/
28       //- Class/Member Variables -/
29      //--------------------------/
30  
31      /**
32       * 
33       *             Flag specifying whether this profile is active
34       * as a default.
35       *           
36       */
37      private boolean activeByDefault = false;
38  
39      /**
40       * 
41       *             
42       *             Specifies that this profile will be activated
43       * when a matching JDK is detected.
44       *             
45       *           
46       */
47      private String jdk;
48  
49      /**
50       * 
51       *             
52       *             Specifies that this profile will be activated
53       * when matching OS attributes are detected.
54       *             
55       *           
56       */
57      private ActivationOS os;
58  
59      /**
60       * 
61       *             
62       *             Specifies that this profile will be activated
63       * when this System property is specified.
64       *             
65       *           
66       */
67      private ActivationProperty property;
68  
69      /**
70       * 
71       *             
72       *             Specifies that this profile will be activated
73       * based on existence of a file.
74       *             
75       *           
76       */
77      private ActivationFile file;
78  
79  
80        //-----------/
81       //- Methods -/
82      //-----------/
83  
84      /**
85       * Get 
86       *             
87       *             Specifies that this profile will be activated
88       * based on existence of a file.
89       *             
90       *           
91       * 
92       * @return ActivationFile
93       */
94      public ActivationFile getFile()
95      {
96          return this.file;
97      } //-- ActivationFile getFile() 
98  
99      /**
100      * Get 
101      *             
102      *             Specifies that this profile will be activated
103      * when a matching JDK is detected.
104      *             
105      *           
106      * 
107      * @return String
108      */
109     public String getJdk()
110     {
111         return this.jdk;
112     } //-- String getJdk() 
113 
114     /**
115      * Get 
116      *             
117      *             Specifies that this profile will be activated
118      * when matching OS attributes are detected.
119      *             
120      *           
121      * 
122      * @return ActivationOS
123      */
124     public ActivationOS getOs()
125     {
126         return this.os;
127     } //-- ActivationOS getOs() 
128 
129     /**
130      * Get 
131      *             
132      *             Specifies that this profile will be activated
133      * when this System property is specified.
134      *             
135      *           
136      * 
137      * @return ActivationProperty
138      */
139     public ActivationProperty getProperty()
140     {
141         return this.property;
142     } //-- ActivationProperty getProperty() 
143 
144     /**
145      * Get 
146      *             Flag specifying whether this profile is active
147      * as a default.
148      *           
149      * 
150      * @return boolean
151      */
152     public boolean isActiveByDefault()
153     {
154         return this.activeByDefault;
155     } //-- boolean isActiveByDefault() 
156 
157     /**
158      * Set 
159      *             Flag specifying whether this profile is active
160      * as a default.
161      *           
162      * 
163      * @param activeByDefault
164      */
165     public void setActiveByDefault( boolean activeByDefault )
166     {
167         this.activeByDefault = activeByDefault;
168     } //-- void setActiveByDefault( boolean ) 
169 
170     /**
171      * Set 
172      *             
173      *             Specifies that this profile will be activated
174      * based on existence of a file.
175      *             
176      *           
177      * 
178      * @param file
179      */
180     public void setFile( ActivationFile file )
181     {
182         this.file = file;
183     } //-- void setFile( ActivationFile ) 
184 
185     /**
186      * Set 
187      *             
188      *             Specifies that this profile will be activated
189      * when a matching JDK is detected.
190      *             
191      *           
192      * 
193      * @param jdk
194      */
195     public void setJdk( String jdk )
196     {
197         this.jdk = jdk;
198     } //-- void setJdk( String ) 
199 
200     /**
201      * Set 
202      *             
203      *             Specifies that this profile will be activated
204      * when matching OS attributes are detected.
205      *             
206      *           
207      * 
208      * @param os
209      */
210     public void setOs( ActivationOS os )
211     {
212         this.os = os;
213     } //-- void setOs( ActivationOS ) 
214 
215     /**
216      * Set 
217      *             
218      *             Specifies that this profile will be activated
219      * when this System property is specified.
220      *             
221      *           
222      * 
223      * @param property
224      */
225     public void setProperty( ActivationProperty property )
226     {
227         this.property = property;
228     } //-- void setProperty( ActivationProperty ) 
229 
230 
231     private String modelEncoding = "UTF-8";
232 
233     /**
234      * Set an encoding used for reading/writing the model.
235      *
236      * @param modelEncoding the encoding used when reading/writing the model.
237      */
238     public void setModelEncoding( String modelEncoding )
239     {
240         this.modelEncoding = modelEncoding;
241     }
242 
243     /**
244      * @return the current encoding used when reading/writing this model.
245      */
246     public String getModelEncoding()
247     {
248         return modelEncoding;
249     }
250 }