001: /*
002: * Project: BeautyJ - Customizable Java Source Code Transformer
003: * Class: de.gulden.application.beautyj.ant.Task
004: * Version: 1.1
005: *
006: * Date: 2004-09-29
007: *
008: * Note: Contains auto-generated Javadoc comments created by BeautyJ.
009: *
010: * This is licensed under the GNU General Public License (GPL)
011: * and comes with NO WARRANTY. See file license.txt for details.
012: *
013: * Author: Jens Gulden
014: * Email: beautyj@jensgulden.de
015: */
016:
017: package de.gulden.application.beautyj.ant;
018:
019: import de.gulden.application.beautyj.BeautyJ;
020: import de.gulden.framework.amoda.model.option.Option;
021: import de.gulden.framework.amoda.generic.core.GenericApplication;
022: import de.gulden.framework.amoda.environment.ant.ANTTaskApplicationWrapper;
023:
024: /**
025: * Application wrapper for running BeautyJ as an ANT task.
026: *
027: * @author Jens Gulden
028: * @version 1.1
029: * @see de.gulden.application.beautyj.BeautyJ
030: * @see de.gulden.framework.amoda.environment.ant.ANTTaskApplicationWrapper
031: */
032: public class Task extends ANTTaskApplicationWrapper {
033:
034: // ------------------------------------------------------------------------
035: // --- methods ---
036: // ------------------------------------------------------------------------
037:
038: /**
039: * Creates the wrapped application.
040: */
041: public GenericApplication createWrappedApplication() {
042: return new BeautyJ();
043: }
044:
045: /**
046: * The directory to output the beautified sources to.
047: */
048: public void setOutput_directory(String s) {
049: setOption("output-directory", s);
050: }
051:
052: /**
053: * The directory to output the beautified sources to.
054: */
055: public void setD(String s) {
056: setOption("output-directory", s);
057: }
058:
059: /**
060: * Full class name of the Sourclet to be used for generating beautified class files.
061: * (Default: de.gulden.util.javasource.sourclet.standard.StandardSourclet)
062: */
063: public void setSourclet(String s) {
064: setOption("sourclet", s);
065: }
066:
067: /**
068: * (Default: false)
069: */
070: public void setQuiet(String s) {
071: setOption("quiet", s);
072: }
073:
074: /**
075: * (Default: false)
076: */
077: public void setVerbose(String s) {
078: setOption("verbose", s);
079: }
080:
081: /**
082: * (Default: false)
083: */
084: public void setTest(String s) {
085: setOption("test", s);
086: }
087:
088: /**
089: */
090: public void setProperties(String s) {
091: setOption("properties", s);
092: }
093:
094: /**
095: * The project's name.
096: */
097: public void setProject_name(String s) {
098: setOption("project.name", s);
099: }
100:
101: /**
102: * The project's version number.
103: */
104: public void setProject_version(String s) {
105: setOption("project.version", s);
106: }
107:
108: /**
109: * The project's date.
110: * (Default: today)
111: */
112: public void setProject_date(String s) {
113: setOption("project.date", s);
114: }
115:
116: /**
117: * Short description of the project.
118: */
119: public void setProject_description(String 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 s) {
127: setOption("project.headerfile", s);
128: }
129:
130: /**
131: * The author's name.
132: */
133: public void setAuthor_name(String s) {
134: setOption("author.name", s);
135: }
136:
137: /**
138: * The author's email address.
139: */
140: public void setAuthor_email(String 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 s) {
385: setOption("xml.doctype", s);
386: }
387:
388: } // end Task
|