1
2
3
4
5 package org.apache.maven.plugin.tools.model;
6
7
8
9
10
11 import java.util.Date;
12
13 /**
14 *
15 * A parameter used by a mojo, and configurable from the
16 * command line or POM configuration sections.
17 *
18 *
19 * @version $Revision$ $Date$
20 */
21 public class Parameter implements java.io.Serializable {
22
23
24
25
26
27
28 /**
29 * Field name
30 */
31 private String name;
32
33 /**
34 * Field alias
35 */
36 private String alias;
37
38 /**
39 * Field property
40 */
41 private String property;
42
43 /**
44 * Field required
45 */
46 private boolean required = false;
47
48 /**
49 * Field readonly
50 */
51 private boolean readonly = false;
52
53 /**
54 * Field expression
55 */
56 private String expression;
57
58 /**
59 * Field defaultValue
60 */
61 private String defaultValue;
62
63 /**
64 * Field type
65 */
66 private String type;
67
68 /**
69 * Field description
70 */
71 private String description;
72
73 /**
74 * Field deprecation
75 */
76 private String deprecation;
77
78
79
80
81
82
83 /**
84 * Get An alternate name for the parameter.
85 */
86 public String getAlias()
87 {
88 return this.alias;
89 }
90
91 /**
92 * Get
93 * An expression in the form ${instance.property}
94 * for extracting a value for this parameter, especially from
95 * a runtime instance within the build system. (eg.
96 * ${project.build.directory} references
97 * project.getBuild().getDirectory())
98 *
99 */
100 public String getDefaultValue()
101 {
102 return this.defaultValue;
103 }
104
105 /**
106 * Get A deprecation message for this mojo parameter.
107 */
108 public String getDeprecation()
109 {
110 return this.deprecation;
111 }
112
113 /**
114 * Get The description for this parameter.
115 */
116 public String getDescription()
117 {
118 return this.description;
119 }
120
121 /**
122 * Get
123 * The command-line reference to this parameter.
124 *
125 */
126 public String getExpression()
127 {
128 return this.expression;
129 }
130
131 /**
132 * Get The parameter name
133 */
134 public String getName()
135 {
136 return this.name;
137 }
138
139 /**
140 * Get The JavaBeans property name to use to configure the mojo
141 * with this parameter.
142 */
143 public String getProperty()
144 {
145 return this.property;
146 }
147
148 /**
149 * Get
150 * The java type for this parameter.
151 *
152 */
153 public String getType()
154 {
155 return this.type;
156 }
157
158 /**
159 * Get
160 * Whether this parameter can be directly edited.
161 * If false, this param is either derived from another POM
162 * element, or refers to a runtime instance of the build
163 * system.
164 *
165 */
166 public boolean isReadonly()
167 {
168 return this.readonly;
169 }
170
171 /**
172 * Get Whether this parameter is required.
173 */
174 public boolean isRequired()
175 {
176 return this.required;
177 }
178
179 /**
180 * Set An alternate name for the parameter.
181 *
182 * @param alias
183 */
184 public void setAlias(String alias)
185 {
186 this.alias = alias;
187 }
188
189 /**
190 * Set
191 * An expression in the form ${instance.property}
192 * for extracting a value for this parameter, especially from
193 * a runtime instance within the build system. (eg.
194 * ${project.build.directory} references
195 * project.getBuild().getDirectory())
196 *
197 *
198 * @param defaultValue
199 */
200 public void setDefaultValue(String defaultValue)
201 {
202 this.defaultValue = defaultValue;
203 }
204
205 /**
206 * Set A deprecation message for this mojo parameter.
207 *
208 * @param deprecation
209 */
210 public void setDeprecation(String deprecation)
211 {
212 this.deprecation = deprecation;
213 }
214
215 /**
216 * Set The description for this parameter.
217 *
218 * @param description
219 */
220 public void setDescription(String description)
221 {
222 this.description = description;
223 }
224
225 /**
226 * Set
227 * The command-line reference to this parameter.
228 *
229 *
230 * @param expression
231 */
232 public void setExpression(String expression)
233 {
234 this.expression = expression;
235 }
236
237 /**
238 * Set The parameter name
239 *
240 * @param name
241 */
242 public void setName(String name)
243 {
244 this.name = name;
245 }
246
247 /**
248 * Set The JavaBeans property name to use to configure the mojo
249 * with this parameter.
250 *
251 * @param property
252 */
253 public void setProperty(String property)
254 {
255 this.property = property;
256 }
257
258 /**
259 * Set
260 * Whether this parameter can be directly edited.
261 * If false, this param is either derived from another POM
262 * element, or refers to a runtime instance of the build
263 * system.
264 *
265 *
266 * @param readonly
267 */
268 public void setReadonly(boolean readonly)
269 {
270 this.readonly = readonly;
271 }
272
273 /**
274 * Set Whether this parameter is required.
275 *
276 * @param required
277 */
278 public void setRequired(boolean required)
279 {
280 this.required = required;
281 }
282
283 /**
284 * Set
285 * The java type for this parameter.
286 *
287 *
288 * @param type
289 */
290 public void setType(String type)
291 {
292 this.type = type;
293 }
294
295
296 private String modelEncoding = "UTF-8";
297
298 public void setModelEncoding( String modelEncoding )
299 {
300 this.modelEncoding = modelEncoding;
301 }
302
303 public String getModelEncoding()
304 {
305 return modelEncoding;
306 }}