KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > gulden > application > beautyj > ant > Task


1 /*
2  * Project: BeautyJ - Customizable Java Source Code Transformer
3  * Class: de.gulden.application.beautyj.ant.Task
4  * Version: 1.1
5  *
6  * Date: 2004-09-29
7  *
8  * Note: Contains auto-generated Javadoc comments created by BeautyJ.
9  *
10  * This is licensed under the GNU General Public License (GPL)
11  * and comes with NO WARRANTY. See file license.txt for details.
12  *
13  * Author: Jens Gulden
14  * Email: beautyj@jensgulden.de
15  */

16
17 package de.gulden.application.beautyj.ant;
18
19 import de.gulden.application.beautyj.BeautyJ;
20 import de.gulden.framework.amoda.model.option.Option;
21 import de.gulden.framework.amoda.generic.core.GenericApplication;
22 import de.gulden.framework.amoda.environment.ant.ANTTaskApplicationWrapper;
23
24 /**
25  * Application wrapper for running BeautyJ as an ANT task.
26  *
27  * @author Jens Gulden
28  * @version 1.1
29  * @see de.gulden.application.beautyj.BeautyJ
30  * @see de.gulden.framework.amoda.environment.ant.ANTTaskApplicationWrapper
31  */

32 public class Task extends ANTTaskApplicationWrapper {
33
34     // ------------------------------------------------------------------------
35
// --- methods ---
36
// ------------------------------------------------------------------------
37

38     /**
39      * Creates the wrapped application.
40      */

41     public GenericApplication createWrappedApplication() {
42         return new BeautyJ();
43     }
44
45     /**
46      * The directory to output the beautified sources to.
47      */

48     public void setOutput_directory(String JavaDoc s) {
49         setOption("output-directory", s);
50     }
51
52     /**
53      * The directory to output the beautified sources to.
54      */

55     public void setD(String JavaDoc s) {
56         setOption("output-directory", s);
57     }
58
59     /**
60      * Full class name of the Sourclet to be used for generating beautified class files.
61      * (Default: de.gulden.util.javasource.sourclet.standard.StandardSourclet)
62      */

63     public void setSourclet(String JavaDoc s) {
64         setOption("sourclet", s);
65     }
66
67     /**
68      * (Default: false)
69      */

70     public void setQuiet(String JavaDoc s) {
71         setOption("quiet", s);
72     }
73
74     /**
75      * (Default: false)
76      */

77     public void setVerbose(String JavaDoc s) {
78         setOption("verbose", s);
79     }
80
81     /**
82      * (Default: false)
83      */

84     public void setTest(String JavaDoc s) {
85         setOption("test", s);
86     }
87
88     /**
89      */

90     public void setProperties(String JavaDoc s) {
91         setOption("properties", s);
92     }
93
94     /**
95      * The project's name.
96      */

97     public void setProject_name(String JavaDoc s) {
98         setOption("project.name", s);
99     }
100
101     /**
102      * The project's version number.
103      */

104     public void setProject_version(String JavaDoc s) {
105         setOption("project.version", s);
106     }
107
108     /**
109      * The project's date.
110      * (Default: today)
111      */

112     public void setProject_date(String JavaDoc s) {
113         setOption("project.date", s);
114     }
115
116     /**
117      * Short description of the project.
118      */

119     public void setProject_description(String JavaDoc s) {
120         setOption("project.description", s);
121     }
122
123     /**
124      * A text file to insert as header comment (instead of auto-building a header with project and author information).
125      */

126     public void setProject_headerfile(String JavaDoc s) {
127         setOption("project.headerfile", s);
128     }
129
130     /**
131      * The author's name.
132      */

133     public void setAuthor_name(String JavaDoc s) {
134         setOption("author.name", s);
135     }
136
137     /**
138      * The author's email address.
139      */

140     public void setAuthor_email(String JavaDoc s) {
141         setOption("author.email", s);
142     }
143
144     /**
145      * Remove dummy content from a class-header's javadoc. Possible values are (multiple possible, comma-seperated): description, author, version
146      */

147     public void setClass_remove_dummy(String JavaDoc s) {
148         setOption("class.remove.dummy", s);
149     }
150
151     /**
152      * Remove empty content from a class's javadoc comment. Possible values are (multiple possible, comma-seperated): description, author, version
153      */

154     public void setClass_remove_empty(String JavaDoc s) {
155         setOption("class.remove.empty", s);
156     }
157
158     /**
159      * Remove any content from a class's javadoc comment. Possible values are (multiple possible, comma-seperated): description, author, version
160      */

161     public void setClass_remove_text(String JavaDoc s) {
162         setOption("class.remove.text", s);
163     }
164
165     /**
166      * Create dummy content for a class's javadoc comment. Possible values are (multiple possible, comma-seperated): description, author, version
167      */

168     public void setClass_create_dummy(String JavaDoc s) {
169         setOption("class.create.dummy", s);
170     }
171
172     /**
173      * Create auto-text content for a class's javadoc comment. Possible values are (multiple possible, comma-seperated): description, author, version
174      */

175     public void setClass_create_text(String JavaDoc s) {
176         setOption("class.create.text", s);
177     }
178
179     /**
180      * Remove dummy content from a method's or constructor's javadoc comment. Possible values are (multiple possible, comma-seperated): description, param, return, throws
181      */

182     public void setMethod_remove_dummy(String JavaDoc s) {
183         setOption("method.remove.dummy", s);
184     }
185
186     /**
187      * Remove empty content from a method's or constructor's javadoc comment. Possible values are (multiple possible, comma-seperated): description, param, return, throws
188      */

189     public void setMethod_remove_empty(String JavaDoc s) {
190         setOption("method.remove.empty", s);
191     }
192
193     /**
194      * Remove any content from a method's or constructor's javadoc comment. Possible values are (multiple possible, comma-seperated): description, param, return, throws
195      */

196     public void setMethod_remove_text(String JavaDoc s) {
197         setOption("method.remove.text", s);
198     }
199
200     /**
201      * Create dummy content for a method's or constructor's javadoc comment. Possible values are (multiple possible, comma-seperated): description, param, return, throws
202      */

203     public void setMethod_create_dummy(String JavaDoc s) {
204         setOption("method.create.dummy", s);
205     }
206
207     /**
208      * Create auto-text content for a method's or constructor's javadoc comment. Possible values are (multiple possible, comma-seperated): description, param, return, throws
209      */

210     public void setMethod_create_text(String JavaDoc s) {
211         setOption("method.create.text", s);
212     }
213
214     /**
215      * Remove dummy description from a field's javadoc comment, if set to 'description'.
216      */

217     public void setField_remove_dummy(String JavaDoc s) {
218         setOption("field.remove.dummy", s);
219     }
220
221     /**
222      * Remove empty description from a field's javadoc comment, if set to 'description'.
223      */

224     public void setField_remove_empty(String JavaDoc s) {
225         setOption("field.remove.empty", s);
226     }
227
228     /**
229      * Remove any description from a field's javadoc comment, if set to 'description'.
230      */

231     public void setField_remove_text(String JavaDoc s) {
232         setOption("field.remove.text", s);
233     }
234
235     /**
236      * Create dummy description for a field's javadoc comment, if set to 'description'.
237      */

238     public void setField_create_dummy(String JavaDoc s) {
239         setOption("field.create.dummy", s);
240     }
241
242     /**
243      * Create auto-text description for a field's javadoc comment, if set to 'description'.
244      */

245     public void setField_create_text(String JavaDoc s) {
246         setOption("field.create.text", s);
247     }
248
249     /**
250      * Sets default comment texts for thrown exceptions. The default values need not to be repeated if you want them leave unchanged and add some more. Example: 'MalformedURLException=if the url is not legal,NumberFormatException=if the string does not represent a number'."
251      */

252     public void setException_texts(String JavaDoc s) {
253         setOption("exception.texts", s);
254     }
255
256     /**
257      * Choose between a code formatting style that outputs a line-break before the first starting curly brace ( '{' ) of a method (if set to true), or output it at the end of the method's declaring line (if set to false).
258      * (Default: false)
259      */

260     public void setCode_braces_linebreak(String JavaDoc s) {
261         setOption("code.braces.linebreak", s);
262     }
263
264     /**
265      * Choose between a code formatting style that outputs a line-break before the first starting curly brace ( '{' ) of a method (if set to true), or output it at the end of the method's declaring line (if set to false).
266      * (Default: false)
267      */

268     public void setB(String JavaDoc s) {
269         setOption("code.braces.linebreak", s);
270     }
271
272     /**
273      * Remove out-commented dead lines of code from the inner method bodies. Every line that starts with '//' and ends with ';', '{' or '}' will be removed.
274      * (Default: false)
275      */

276     public void setCode_clean(String JavaDoc s) {
277         setOption("code.clean", s);
278     }
279
280     /**
281      * Remove out-commented dead lines of code from the inner method bodies. Every line that starts with '//' and ends with ';', '{' or '}' will be removed.
282      * (Default: false)
283      */

284     public void setC(String JavaDoc s) {
285         setOption("code.clean", s);
286     }
287
288     /**
289      * Insert comment blocks between different types of class members. This highly increases readabilty.
290      * (Default: true)
291      */

292     public void setCode_separators(String JavaDoc s) {
293         setOption("code.separators", s);
294     }
295
296     /**
297      * Preserve the order of field declarations as they are given in the orignal source file. In some cases this might be necessary to avoid illegal forward references when compiling the beautified sources.
298      * (Default: false)
299      */

300     public void setCode_preserve_fields_order(String JavaDoc s) {
301         setOption("code.preserve.fields.order", s);
302     }
303
304     /**
305      * Format code blocks by auto-indenting the lines to a normalized standard-representation.
306      * (Default: false)
307      */

308     public void setCode_format(String JavaDoc s) {
309         setOption("code.format", s);
310     }
311
312     /**
313      * Format code blocks by auto-indenting the lines to a normalized standard-representation.
314      * (Default: false)
315      */

316     public void setF(String JavaDoc s) {
317         setOption("code.format", s);
318     }
319
320     /**
321      * Sets the number of spaces with which auto-indentation gets performed.
322      * (Default: 4)
323      */

324     public void setCode_indent_spaces(String JavaDoc s) {
325         setOption("code.indent.spaces", s);
326     }
327
328     /**
329      * Sets the number of spaces with which auto-indentation gets performed.
330      * (Default: 4)
331      */

332     public void setI(String JavaDoc s) {
333         setOption("code.indent.spaces", s);
334     }
335
336     /**
337      * Use fully qualified class names in the generated output. (E.g. use 'java.lang.String' instead of 'String'.) This might be needed in order to avoid ambiguity in class names. Usually, the classes and interfaces used in member signatures are declared by import statements.
338      * (Default: false)
339      */

340     public void setCode_qualify(String JavaDoc s) {
341         setOption("code.qualify", s);
342     }
343
344     /**
345      * Use fully qualified class names in the generated output. (E.g. use 'java.lang.String' instead of 'String'.) This might be needed in order to avoid ambiguity in class names. Usually, the classes and interfaces used in member signatures are declared by import statements.
346      * (Default: false)
347      */

348     public void setQ(String JavaDoc s) {
349         setOption("code.qualify", s);
350     }
351
352     /**
353      * If option -code.qualify is disabled (which is default), fully qualifiy those class-names which would otherwise be unqualifiyable.
354      * (Default: true)
355      */

356     public void setCode_qualify_auto(String JavaDoc s) {
357         setOption("code.qualify.auto", s);
358     }
359
360     /**
361      * Read Java source from XML file, not from .java-files. Then beautify and output as .java-files. Use "-xml.in=" without specifying a file name to read from standard in.
362      */

363     public void setXml_in(String JavaDoc s) {
364         setOption("xml.in", s);
365     }
366
367     /**
368      * Parse Java source and create XML file, without performing any beautification. Use "-xml.out=" without specifying a file name to write to standard out, in this case option -quiet is implicit.
369      */

370     public void setXml_out(String JavaDoc s) {
371         setOption("xml.out", s);
372     }
373
374     /**
375      * Validate the input XML against its DTD before parsing. The input file must contain a <!DOCTYPE ..> declaration. Can be used only in combination with -xml.in.
376      */

377     public void setXml_validate(String JavaDoc s) {
378         setOption("xml.validate", s);
379     }
380
381     /**
382      * Include a <!DOCTYPE ..> reference into generated XML. Can be used only in combination with -xml.out.
383      */

384     public void setXml_doctype(String JavaDoc s) {
385         setOption("xml.doctype", s);
386     }
387
388 } // end Task
389
Popular Tags