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