Class JavaCCMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.codehaus.mojo.javacc.AbstractJavaCCMojo
org.codehaus.mojo.javacc.JavaCCMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="javacc",
defaultPhase=GENERATE_SOURCES,
threadSafe=true)
public class JavaCCMojo
extends AbstractJavaCCMojo
Parses a JavaCC grammar file (
*.jj) and transforms it to Java source files. Detailed information
about the JavaCC options can be found on the JavaCC website.- Since:
- 2.0
- Author:
- jruiz@exist.com, jesse jesse.mcconnell@gmail.com
-
Field Summary
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected File[]Gets all the output directories to register with the project for compilation.protected String[]Gets a set of Ant-like exclusion patterns used to unselect files from the source directory for processing.protected String[]Gets a set of Ant-like inclusion patterns used to select files from the source directory for processing.protected FileGets the absolute path to the directory where the generated Java files for the parser will be stored.protected StringGets the package into which the generated parser files should be stored.protected FileGets the absolute path to the directory where the grammar files are located.protected intGets the granularity in milliseconds of the last modification date for testing whether a source needs recompilation.protected voidprocessGrammar(org.codehaus.mojo.javacc.GrammarInfo grammarInfo) Passes the specified grammar file through the tool.Methods inherited from class org.codehaus.mojo.javacc.AbstractJavaCCMojo
copyGrammarOutput, deleteTempDirectory, execute, getGrammarEncoding, getIsStatic, getJdkVersion, getTempDirectory, isSourceRoot, newJavaCCMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
JavaCCMojo
public JavaCCMojo()
-
-
Method Details
-
getSourceDirectory
Gets the absolute path to the directory where the grammar files are located.- Specified by:
getSourceDirectoryin classAbstractJavaCCMojo- Returns:
- The absolute path to the directory where the grammar files are located, never
null.
-
getIncludes
Gets a set of Ant-like inclusion patterns used to select files from the source directory for processing.- Specified by:
getIncludesin classAbstractJavaCCMojo- Returns:
- A set of Ant-like inclusion patterns used to select files from the source directory for processing, can
be
nullif all files should be included.
-
getExcludes
Gets a set of Ant-like exclusion patterns used to unselect files from the source directory for processing.- Specified by:
getExcludesin classAbstractJavaCCMojo- Returns:
- A set of Ant-like inclusion patterns used to unselect files from the source directory for processing, can
be
nullif no files should be excluded.
-
getOutputDirectory
Gets the absolute path to the directory where the generated Java files for the parser will be stored.- Specified by:
getOutputDirectoryin classAbstractJavaCCMojo- Returns:
- The absolute path to the directory where the generated Java files for the parser will be stored, never
null.
-
getStaleMillis
protected int getStaleMillis()Gets the granularity in milliseconds of the last modification date for testing whether a source needs recompilation.- Specified by:
getStaleMillisin classAbstractJavaCCMojo- Returns:
- The granularity in milliseconds of the last modification date for testiintng whether a source needs recompilation.
-
getCompileSourceRoots
Gets all the output directories to register with the project for compilation.- Specified by:
getCompileSourceRootsin classAbstractJavaCCMojo- Returns:
- The compile source roots to register with the project, never
null.
-
getParserPackage
Gets the package into which the generated parser files should be stored.- Overrides:
getParserPackagein classAbstractJavaCCMojo- Returns:
- The package into which the generated parser files should be stored, can be
nullto use the package declaration from the grammar file.
-
processGrammar
protected void processGrammar(org.codehaus.mojo.javacc.GrammarInfo grammarInfo) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException Passes the specified grammar file through the tool.- Specified by:
processGrammarin classAbstractJavaCCMojo- Parameters:
grammarInfo- The grammar info describing the grammar file to process, must not benull.- Throws:
org.apache.maven.plugin.MojoExecutionException- If the invocation of the tool failed.org.apache.maven.plugin.MojoFailureException- If the tool reported a non-zero exit code.
-