org.codehaus.mojo.javacc
Class JJTreeJavaCCMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.codehaus.mojo.javacc.AbstractJavaCCMojo
          extended by org.codehaus.mojo.javacc.JJTreeJavaCCMojo
All Implemented Interfaces:
ContextEnabled, Mojo

public class JJTreeJavaCCMojo
extends AbstractJavaCCMojo

Preprocesses decorated grammar files (*.jjt) with JJTree and passes the output to JavaCC in order to finally generate a parser with parse tree actions.

Since:
2.4
Version:
$Id: JJTreeJavaCCMojo.java 10603 2009-09-06 15:05:08Z bentmann $
Author:
Benjamin Bentmann
Is bound to the specified phase of the standard build lifecycle:
generate-sources
Is defined by the goal name:
jjtree-javacc

Field Summary
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
JJTreeJavaCCMojo()
           
 
Method Summary
protected  File[] getCompileSourceRoots()
          Gets all the output directories to register with the project for compilation.
protected  String[] getExcludes()
          Gets a set of Ant-like exclusion patterns used to unselect files from the source directory for processing.
protected  String[] getIncludes()
          Gets a set of Ant-like inclusion patterns used to select files from the source directory for processing.
protected  File getOutputDirectory()
          Gets the absolute path to the directory where the generated Java files for the parser will be stored.
protected  File getSourceDirectory()
          Gets the absolute path to the directory where the grammar files are located.
protected  int getStaleMillis()
          Gets the granularity in milliseconds of the last modification date for testing whether a source needs recompilation.
protected  org.codehaus.mojo.javacc.JJTree newJJTree()
          Creates a new facade to invoke JJTree.
protected  void processGrammar(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, getParserPackage, getTempDirectory, isSourceRoot, newJavaCC
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JJTreeJavaCCMojo

public JJTreeJavaCCMojo()
Method Detail

getSourceDirectory

protected File getSourceDirectory()
Gets the absolute path to the directory where the grammar files are located.

Specified by:
getSourceDirectory in class AbstractJavaCCMojo
Returns:
The absolute path to the directory where the grammar files are located, never null.

getIncludes

protected String[] getIncludes()
Gets a set of Ant-like inclusion patterns used to select files from the source directory for processing.

Specified by:
getIncludes in class AbstractJavaCCMojo
Returns:
A set of Ant-like inclusion patterns used to select files from the source directory for processing, can be null if all files should be included.

getExcludes

protected String[] getExcludes()
Gets a set of Ant-like exclusion patterns used to unselect files from the source directory for processing.

Specified by:
getExcludes in class AbstractJavaCCMojo
Returns:
A set of Ant-like inclusion patterns used to unselect files from the source directory for processing, can be null if no files should be excluded.

getOutputDirectory

protected File getOutputDirectory()
Gets the absolute path to the directory where the generated Java files for the parser will be stored.

Specified by:
getOutputDirectory in class AbstractJavaCCMojo
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:
getStaleMillis in class AbstractJavaCCMojo
Returns:
The granularity in milliseconds of the last modification date for testing whether a source needs recompilation.

getCompileSourceRoots

protected File[] getCompileSourceRoots()
Gets all the output directories to register with the project for compilation.

Specified by:
getCompileSourceRoots in class AbstractJavaCCMojo
Returns:
The compile source roots to register with the project, never null.

processGrammar

protected void processGrammar(org.codehaus.mojo.javacc.GrammarInfo grammarInfo)
                       throws MojoExecutionException,
                              MojoFailureException
Passes the specified grammar file through the tool.

Specified by:
processGrammar in class AbstractJavaCCMojo
Parameters:
grammarInfo - The grammar info describing the grammar file to process, must not be null.
Throws:
MojoExecutionException - If the invocation of the tool failed.
MojoFailureException - If the tool reported a non-zero exit code.

newJJTree

protected org.codehaus.mojo.javacc.JJTree newJJTree()
Creates a new facade to invoke JJTree. Most options for the invocation are derived from the current values of the corresponding mojo parameters. The caller is responsible to set the input file, output directory and package on the returned facade.

Returns:
The facade for the tool invocation, never null.


Copyright © 2005-2012 Codehaus. All Rights Reserved.