Browse Source

checkstyle

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@471918 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 18 years ago
parent
commit
c243b19fe3
3 changed files with 96 additions and 31 deletions
  1. +11
    -2
      src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJDoc.java
  2. +30
    -11
      src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java
  3. +55
    -18
      src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java

+ 11
- 2
src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJDoc.java View File

@@ -61,23 +61,26 @@ public class JJDoc extends Task {


/** /**
* Sets the TEXT BNF documentation option. * Sets the TEXT BNF documentation option.
* @param plainText a <code>boolean</code> value.
*/ */
public void setText(boolean plainText) { public void setText(boolean plainText) {
optionalAttrs.put(TEXT, new Boolean(plainText));
optionalAttrs.put(TEXT, plainText ? Boolean.TRUE : Boolean.FALSE);
this.plainText = plainText; this.plainText = plainText;
} }


/** /**
* Sets the ONE_TABLE documentation option. * Sets the ONE_TABLE documentation option.
* @param oneTable a <code>boolean</code> value.
*/ */
public void setOnetable(boolean oneTable) { public void setOnetable(boolean oneTable) {
optionalAttrs.put(ONE_TABLE, new Boolean(oneTable));
optionalAttrs.put(ONE_TABLE, oneTable ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* The outputfile to write the generated BNF documentation file to. * The outputfile to write the generated BNF documentation file to.
* If not set, the file is written with the same name as * If not set, the file is written with the same name as
* the JavaCC grammar file with a suffix .html or .txt. * the JavaCC grammar file with a suffix .html or .txt.
* @param outputFile the name of the output file.
*/ */
public void setOutputfile(String outputFile) { public void setOutputfile(String outputFile) {
this.outputFile = outputFile; this.outputFile = outputFile;
@@ -85,6 +88,7 @@ public class JJDoc extends Task {


/** /**
* The javacc grammar file to process. * The javacc grammar file to process.
* @param target the grammar file.
*/ */
public void setTarget(File target) { public void setTarget(File target) {
this.targetFile = target; this.targetFile = target;
@@ -92,6 +96,7 @@ public class JJDoc extends Task {


/** /**
* The directory containing the JavaCC distribution. * The directory containing the JavaCC distribution.
* @param javaccHome the home directory.
*/ */
public void setJavacchome(File javaccHome) { public void setJavacchome(File javaccHome) {
this.javaccHome = javaccHome; this.javaccHome = javaccHome;
@@ -104,6 +109,10 @@ public class JJDoc extends Task {
cmdl.setVm(JavaEnvUtils.getJreExecutable("java")); cmdl.setVm(JavaEnvUtils.getJreExecutable("java"));
} }


/**
* Do the task.
* @throws BuildException if there is an error.
*/
public void execute() throws BuildException { public void execute() throws BuildException {


// load command line with optional attributes // load command line with optional attributes


+ 30
- 11
src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java View File

@@ -70,85 +70,97 @@ public class JJTree extends Task {


/** /**
* Sets the BUILD_NODE_FILES grammar option. * Sets the BUILD_NODE_FILES grammar option.
* @param buildNodeFiles a <code>boolean</code> value.
*/ */
public void setBuildnodefiles(boolean buildNodeFiles) { public void setBuildnodefiles(boolean buildNodeFiles) {
optionalAttrs.put(BUILD_NODE_FILES, new Boolean(buildNodeFiles));
optionalAttrs.put(BUILD_NODE_FILES, buildNodeFiles ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* Sets the MULTI grammar option. * Sets the MULTI grammar option.
* @param multi a <code>boolean</code> value.
*/ */
public void setMulti(boolean multi) { public void setMulti(boolean multi) {
optionalAttrs.put(MULTI, new Boolean(multi));
optionalAttrs.put(MULTI, multi ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* Sets the NODE_DEFAULT_VOID grammar option. * Sets the NODE_DEFAULT_VOID grammar option.
* @param nodeDefaultVoid a <code>boolean</code> value.
*/ */
public void setNodedefaultvoid(boolean nodeDefaultVoid) { public void setNodedefaultvoid(boolean nodeDefaultVoid) {
optionalAttrs.put(NODE_DEFAULT_VOID, new Boolean(nodeDefaultVoid));
optionalAttrs.put(NODE_DEFAULT_VOID, nodeDefaultVoid ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* Sets the NODE_FACTORY grammar option. * Sets the NODE_FACTORY grammar option.
* @param nodeFactory a <code>boolean</code> value.
*/ */
public void setNodefactory(boolean nodeFactory) { public void setNodefactory(boolean nodeFactory) {
optionalAttrs.put(NODE_FACTORY, new Boolean(nodeFactory));
optionalAttrs.put(NODE_FACTORY, nodeFactory ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* Sets the NODE_SCOPE_HOOK grammar option. * Sets the NODE_SCOPE_HOOK grammar option.
* @param nodeScopeHook a <code>boolean</code> value.
*/ */
public void setNodescopehook(boolean nodeScopeHook) { public void setNodescopehook(boolean nodeScopeHook) {
optionalAttrs.put(NODE_SCOPE_HOOK, new Boolean(nodeScopeHook));
optionalAttrs.put(NODE_SCOPE_HOOK, nodeScopeHook ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* Sets the NODE_USES_PARSER grammar option. * Sets the NODE_USES_PARSER grammar option.
* @param nodeUsesParser a <code>boolean</code> value.
*/ */
public void setNodeusesparser(boolean nodeUsesParser) { public void setNodeusesparser(boolean nodeUsesParser) {
optionalAttrs.put(NODE_USES_PARSER, new Boolean(nodeUsesParser));
optionalAttrs.put(NODE_USES_PARSER, nodeUsesParser ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* Sets the STATIC grammar option. * Sets the STATIC grammar option.
* @param staticParser a <code>boolean</code> value.
*/ */
public void setStatic(boolean staticParser) { public void setStatic(boolean staticParser) {
optionalAttrs.put(STATIC, new Boolean(staticParser));
optionalAttrs.put(STATIC, staticParser ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* Sets the VISITOR grammar option. * Sets the VISITOR grammar option.
* @param visitor a <code>boolean</code> value.
*/ */
public void setVisitor(boolean visitor) { public void setVisitor(boolean visitor) {
optionalAttrs.put(VISITOR, new Boolean(visitor));
optionalAttrs.put(VISITOR, visitor ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* Sets the NODE_PACKAGE grammar option. * Sets the NODE_PACKAGE grammar option.
* @param nodePackage the option to use.
*/ */
public void setNodepackage(String nodePackage) { public void setNodepackage(String nodePackage) {
optionalAttrs.put(NODE_PACKAGE, new String(nodePackage));
optionalAttrs.put(NODE_PACKAGE, nodePackage);
} }


/** /**
* Sets the VISITOR_EXCEPTION grammar option. * Sets the VISITOR_EXCEPTION grammar option.
* @param visitorException the option to use.
*/ */
public void setVisitorException(String visitorException) { public void setVisitorException(String visitorException) {
optionalAttrs.put(VISITOR_EXCEPTION, new String(visitorException));
optionalAttrs.put(VISITOR_EXCEPTION, visitorException);
} }


/** /**
* Sets the NODE_PREFIX grammar option. * Sets the NODE_PREFIX grammar option.
* @param nodePrefix the option to use.
*/ */
public void setNodeprefix(String nodePrefix) { public void setNodeprefix(String nodePrefix) {
optionalAttrs.put(NODE_PREFIX, new String(nodePrefix));
optionalAttrs.put(NODE_PREFIX, nodePrefix);
} }


/** /**
* The directory to write the generated JavaCC grammar and node files to. * The directory to write the generated JavaCC grammar and node files to.
* If not set, the files are written to the directory * If not set, the files are written to the directory
* containing the grammar file. * containing the grammar file.
* @param outputDirectory the output directory.
*/ */
public void setOutputdirectory(File outputDirectory) { public void setOutputdirectory(File outputDirectory) {
this.outputDirectory = outputDirectory; this.outputDirectory = outputDirectory;
@@ -158,6 +170,7 @@ public class JJTree extends Task {
* The outputfile to write the generated JavaCC grammar file to. * The outputfile to write the generated JavaCC grammar file to.
* If not set, the file is written with the same name as * If not set, the file is written with the same name as
* the JJTree grammar file with a suffix .jj. * the JJTree grammar file with a suffix .jj.
* @param outputFile the output file name.
*/ */
public void setOutputfile(String outputFile) { public void setOutputfile(String outputFile) {
this.outputFile = outputFile; this.outputFile = outputFile;
@@ -165,6 +178,7 @@ public class JJTree extends Task {


/** /**
* The jjtree grammar file to process. * The jjtree grammar file to process.
* @param targetFile the grammar file.
*/ */
public void setTarget(File targetFile) { public void setTarget(File targetFile) {
this.targetFile = targetFile; this.targetFile = targetFile;
@@ -172,6 +186,7 @@ public class JJTree extends Task {


/** /**
* The directory containing the JavaCC distribution. * The directory containing the JavaCC distribution.
* @param javaccHome the directory containing JavaCC.
*/ */
public void setJavacchome(File javaccHome) { public void setJavacchome(File javaccHome) {
this.javaccHome = javaccHome; this.javaccHome = javaccHome;
@@ -184,6 +199,10 @@ public class JJTree extends Task {
cmdl.setVm(JavaEnvUtils.getJreExecutable("java")); cmdl.setVm(JavaEnvUtils.getJreExecutable("java"));
} }


/**
* Run the task.
* @throws BuildException on error.
*/
public void execute() throws BuildException { public void execute() throws BuildException {


// load command line with optional attributes // load command line with optional attributes


+ 55
- 18
src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java View File

@@ -106,6 +106,7 @@ public class JavaCC extends Task {


/** /**
* Sets the LOOKAHEAD grammar option. * Sets the LOOKAHEAD grammar option.
* @param lookahead an <code>int</code> value.
*/ */
public void setLookahead(int lookahead) { public void setLookahead(int lookahead) {
optionalAttrs.put(LOOKAHEAD, new Integer(lookahead)); optionalAttrs.put(LOOKAHEAD, new Integer(lookahead));
@@ -113,6 +114,7 @@ public class JavaCC extends Task {


/** /**
* Sets the CHOICE_AMBIGUITY_CHECK grammar option. * Sets the CHOICE_AMBIGUITY_CHECK grammar option.
* @param choiceAmbiguityCheck an <code>int</code> value.
*/ */
public void setChoiceambiguitycheck(int choiceAmbiguityCheck) { public void setChoiceambiguitycheck(int choiceAmbiguityCheck) {
optionalAttrs.put(CHOICE_AMBIGUITY_CHECK, new Integer(choiceAmbiguityCheck)); optionalAttrs.put(CHOICE_AMBIGUITY_CHECK, new Integer(choiceAmbiguityCheck));
@@ -120,6 +122,7 @@ public class JavaCC extends Task {


/** /**
* Sets the OTHER_AMBIGUITY_CHECK grammar option. * Sets the OTHER_AMBIGUITY_CHECK grammar option.
* @param otherAmbiguityCheck an <code>int</code> value.
*/ */
public void setOtherambiguityCheck(int otherAmbiguityCheck) { public void setOtherambiguityCheck(int otherAmbiguityCheck) {
optionalAttrs.put(OTHER_AMBIGUITY_CHECK, new Integer(otherAmbiguityCheck)); optionalAttrs.put(OTHER_AMBIGUITY_CHECK, new Integer(otherAmbiguityCheck));
@@ -127,132 +130,152 @@ public class JavaCC extends Task {


/** /**
* Sets the STATIC grammar option. * Sets the STATIC grammar option.
* @param staticParser a <code>boolean</code> value.
*/ */
public void setStatic(boolean staticParser) { public void setStatic(boolean staticParser) {
optionalAttrs.put(STATIC, new Boolean(staticParser));
optionalAttrs.put(STATIC, staticParser ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* Sets the DEBUG_PARSER grammar option. * Sets the DEBUG_PARSER grammar option.
* @param debugParser a <code>boolean</code> value.
*/ */
public void setDebugparser(boolean debugParser) { public void setDebugparser(boolean debugParser) {
optionalAttrs.put(DEBUG_PARSER, new Boolean(debugParser));
optionalAttrs.put(DEBUG_PARSER, debugParser ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* Sets the DEBUG_LOOKAHEAD grammar option. * Sets the DEBUG_LOOKAHEAD grammar option.
* @param debugLookahead a <code>boolean</code> value.
*/ */
public void setDebuglookahead(boolean debugLookahead) { public void setDebuglookahead(boolean debugLookahead) {
optionalAttrs.put(DEBUG_LOOKAHEAD, new Boolean(debugLookahead));
optionalAttrs.put(DEBUG_LOOKAHEAD, debugLookahead ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* Sets the DEBUG_TOKEN_MANAGER grammar option. * Sets the DEBUG_TOKEN_MANAGER grammar option.
* @param debugTokenManager a <code>boolean</code> value.
*/ */
public void setDebugtokenmanager(boolean debugTokenManager) { public void setDebugtokenmanager(boolean debugTokenManager) {
optionalAttrs.put(DEBUG_TOKEN_MANAGER, new Boolean(debugTokenManager));
optionalAttrs.put(DEBUG_TOKEN_MANAGER, debugTokenManager ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* Sets the OPTIMIZE_TOKEN_MANAGER grammar option. * Sets the OPTIMIZE_TOKEN_MANAGER grammar option.
* @param optimizeTokenManager a <code>boolean</code> value.
*/ */
public void setOptimizetokenmanager(boolean optimizeTokenManager) { public void setOptimizetokenmanager(boolean optimizeTokenManager) {
optionalAttrs.put(OPTIMIZE_TOKEN_MANAGER, new Boolean(optimizeTokenManager));
optionalAttrs.put(OPTIMIZE_TOKEN_MANAGER,
optimizeTokenManager ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* Sets the ERROR_REPORTING grammar option. * Sets the ERROR_REPORTING grammar option.
* @param errorReporting a <code>boolean</code> value.
*/ */
public void setErrorreporting(boolean errorReporting) { public void setErrorreporting(boolean errorReporting) {
optionalAttrs.put(ERROR_REPORTING, new Boolean(errorReporting));
optionalAttrs.put(ERROR_REPORTING, errorReporting ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* Sets the JAVA_UNICODE_ESCAPE grammar option. * Sets the JAVA_UNICODE_ESCAPE grammar option.
* @param javaUnicodeEscape a <code>boolean</code> value.
*/ */
public void setJavaunicodeescape(boolean javaUnicodeEscape) { public void setJavaunicodeescape(boolean javaUnicodeEscape) {
optionalAttrs.put(JAVA_UNICODE_ESCAPE, new Boolean(javaUnicodeEscape));
optionalAttrs.put(JAVA_UNICODE_ESCAPE, javaUnicodeEscape ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* Sets the UNICODE_INPUT grammar option. * Sets the UNICODE_INPUT grammar option.
* @param unicodeInput a <code>boolean</code> value.
*/ */
public void setUnicodeinput(boolean unicodeInput) { public void setUnicodeinput(boolean unicodeInput) {
optionalAttrs.put(UNICODE_INPUT, new Boolean(unicodeInput));
optionalAttrs.put(UNICODE_INPUT, unicodeInput ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* Sets the IGNORE_CASE grammar option. * Sets the IGNORE_CASE grammar option.
* @param ignoreCase a <code>boolean</code> value.
*/ */
public void setIgnorecase(boolean ignoreCase) { public void setIgnorecase(boolean ignoreCase) {
optionalAttrs.put(IGNORE_CASE, new Boolean(ignoreCase));
optionalAttrs.put(IGNORE_CASE, ignoreCase ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* Sets the COMMON_TOKEN_ACTION grammar option. * Sets the COMMON_TOKEN_ACTION grammar option.
* @param commonTokenAction a <code>boolean</code> value.
*/ */
public void setCommontokenaction(boolean commonTokenAction) { public void setCommontokenaction(boolean commonTokenAction) {
optionalAttrs.put(COMMON_TOKEN_ACTION, new Boolean(commonTokenAction));
optionalAttrs.put(COMMON_TOKEN_ACTION, commonTokenAction ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* Sets the USER_TOKEN_MANAGER grammar option. * Sets the USER_TOKEN_MANAGER grammar option.
* @param userTokenManager a <code>boolean</code> value.
*/ */
public void setUsertokenmanager(boolean userTokenManager) { public void setUsertokenmanager(boolean userTokenManager) {
optionalAttrs.put(USER_TOKEN_MANAGER, new Boolean(userTokenManager));
optionalAttrs.put(USER_TOKEN_MANAGER, userTokenManager ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* Sets the USER_CHAR_STREAM grammar option. * Sets the USER_CHAR_STREAM grammar option.
* @param userCharStream a <code>boolean</code> value.
*/ */
public void setUsercharstream(boolean userCharStream) { public void setUsercharstream(boolean userCharStream) {
optionalAttrs.put(USER_CHAR_STREAM, new Boolean(userCharStream));
optionalAttrs.put(USER_CHAR_STREAM, userCharStream ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* Sets the BUILD_PARSER grammar option. * Sets the BUILD_PARSER grammar option.
* @param buildParser a <code>boolean</code> value.
*/ */
public void setBuildparser(boolean buildParser) { public void setBuildparser(boolean buildParser) {
optionalAttrs.put(BUILD_PARSER, new Boolean(buildParser));
optionalAttrs.put(BUILD_PARSER, buildParser ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* Sets the BUILD_TOKEN_MANAGER grammar option. * Sets the BUILD_TOKEN_MANAGER grammar option.
* @param buildTokenManager a <code>boolean</code> value.
*/ */
public void setBuildtokenmanager(boolean buildTokenManager) { public void setBuildtokenmanager(boolean buildTokenManager) {
optionalAttrs.put(BUILD_TOKEN_MANAGER, new Boolean(buildTokenManager));
optionalAttrs.put(BUILD_TOKEN_MANAGER, buildTokenManager ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* Sets the SANITY_CHECK grammar option. * Sets the SANITY_CHECK grammar option.
* @param sanityCheck a <code>boolean</code> value.
*/ */
public void setSanitycheck(boolean sanityCheck) { public void setSanitycheck(boolean sanityCheck) {
optionalAttrs.put(SANITY_CHECK, new Boolean(sanityCheck));
optionalAttrs.put(SANITY_CHECK, sanityCheck ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* Sets the FORCE_LA_CHECK grammar option. * Sets the FORCE_LA_CHECK grammar option.
* @param forceLACheck a <code>boolean</code> value.
*/ */
public void setForcelacheck(boolean forceLACheck) { public void setForcelacheck(boolean forceLACheck) {
optionalAttrs.put(FORCE_LA_CHECK, new Boolean(forceLACheck));
optionalAttrs.put(FORCE_LA_CHECK, forceLACheck ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* Sets the CACHE_TOKENS grammar option. * Sets the CACHE_TOKENS grammar option.
* @param cacheTokens a <code>boolean</code> value.
*/ */
public void setCachetokens(boolean cacheTokens) { public void setCachetokens(boolean cacheTokens) {
optionalAttrs.put(CACHE_TOKENS, new Boolean(cacheTokens));
optionalAttrs.put(CACHE_TOKENS, cacheTokens ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* Sets the KEEP_LINE_COLUMN grammar option. * Sets the KEEP_LINE_COLUMN grammar option.
* @param keepLineColumn a <code>boolean</code> value.
*/ */
public void setKeeplinecolumn(boolean keepLineColumn) { public void setKeeplinecolumn(boolean keepLineColumn) {
optionalAttrs.put(KEEP_LINE_COLUMN, new Boolean(keepLineColumn));
optionalAttrs.put(KEEP_LINE_COLUMN, keepLineColumn ? Boolean.TRUE : Boolean.FALSE);
} }


/** /**
* Sets the JDK_VERSION option. * Sets the JDK_VERSION option.
* @param jdkVersion the version to use.
* @since Ant1.7 * @since Ant1.7
*/ */
public void setJDKversion(String jdkVersion) { public void setJDKversion(String jdkVersion) {
@@ -263,6 +286,7 @@ public class JavaCC extends Task {
* The directory to write the generated files to. * The directory to write the generated files to.
* If not set, the files are written to the directory * If not set, the files are written to the directory
* containing the grammar file. * containing the grammar file.
* @param outputDirectory the output directory.
*/ */
public void setOutputdirectory(File outputDirectory) { public void setOutputdirectory(File outputDirectory) {
this.outputDirectory = outputDirectory; this.outputDirectory = outputDirectory;
@@ -270,6 +294,7 @@ public class JavaCC extends Task {


/** /**
* The grammar file to process. * The grammar file to process.
* @param targetFile the grammar file.
*/ */
public void setTarget(File targetFile) { public void setTarget(File targetFile) {
this.targetFile = targetFile; this.targetFile = targetFile;
@@ -277,15 +302,23 @@ public class JavaCC extends Task {


/** /**
* The directory containing the JavaCC distribution. * The directory containing the JavaCC distribution.
* @param javaccHome the directory.
*/ */
public void setJavacchome(File javaccHome) { public void setJavacchome(File javaccHome) {
this.javaccHome = javaccHome; this.javaccHome = javaccHome;
} }


/**
* Constructor
*/
public JavaCC() { public JavaCC() {
cmdl.setVm(JavaEnvUtils.getJreExecutable("java")); cmdl.setVm(JavaEnvUtils.getJreExecutable("java"));
} }


/**
* Run the task.
* @throws BuildException on error.
*/
public void execute() throws BuildException { public void execute() throws BuildException {


// load command line with optional attributes // load command line with optional attributes
@@ -400,6 +433,8 @@ public class JavaCC extends Task {
mainClass = COM_JJDOC_CLASS; mainClass = COM_JJDOC_CLASS;


break; break;
default:
// Fall Through
} }
} else { } else {
javaccClass = ORG_PACKAGE_3_1 + ORG_JAVACC_CLASS; javaccClass = ORG_PACKAGE_3_1 + ORG_JAVACC_CLASS;
@@ -432,6 +467,8 @@ public class JavaCC extends Task {
mainClass = ORG_JJDOC_CLASS; mainClass = ORG_JJDOC_CLASS;


break; break;
default:
// Fall Through
} }
} }
} }


Loading…
Cancel
Save