public abstract class AbstractPreprocessorMojo
extends org.apache.maven.plugin.AbstractMojo
Modifier and Type | Field and Description |
---|---|
private org.apache.maven.project.MavenProject |
project
The current Maven project.
|
Constructor and Description |
---|
AbstractPreprocessorMojo() |
Modifier and Type | Method and Description |
---|---|
protected void |
addCompileSourceRoot()
Registers the configured output directory as a compile source root for the current project.
|
protected void |
createTimestamp(GrammarInfo grammarInfo)
Creates the timestamp file for the specified grammar file.
|
void |
execute()
Execute the tool.
|
protected abstract java.lang.String[] |
getExcludes()
Gets a set of Ant-like exclusion patterns used to unselect files from the source directory for processing.
|
protected abstract java.lang.String[] |
getIncludes()
Gets a set of Ant-like inclusion patterns used to select files from the source directory for processing.
|
protected abstract java.io.File |
getOutputDirectory()
Gets the absolute path to the directory where the generated Java files for the parser will be stored.
|
protected abstract java.io.File |
getSourceDirectory()
Gets the absolute path to the directory where the grammar files are located.
|
protected abstract int |
getStaleMillis()
Gets the granularity in milliseconds of the last modification date for testing whether a source needs
recompilation.
|
protected abstract java.io.File |
getTimestampDirectory()
Gets the absolute path to the directory where the processed input files will be stored for later detection of
stale sources.
|
protected abstract void |
processGrammar(GrammarInfo grammarInfo)
Passes the specified grammar file through the tool.
|
private GrammarInfo[] |
scanForGrammars()
Scans the configured source directory for grammar files which need processing.
|
private org.apache.maven.project.MavenProject project
protected abstract java.io.File getSourceDirectory()
null
.protected abstract java.lang.String[] getIncludes()
null
if all files should be included.protected abstract java.lang.String[] getExcludes()
null
if no files should be excluded.protected abstract java.io.File getOutputDirectory()
null
.protected abstract java.io.File getTimestampDirectory()
null
.protected abstract int getStaleMillis()
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
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.protected abstract void processGrammar(GrammarInfo grammarInfo) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
grammarInfo
- The grammar info describing the grammar file to process, must not be null
.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.private GrammarInfo[] scanForGrammars() throws org.apache.maven.plugin.MojoExecutionException
null
if the source
directory does not exist.org.apache.maven.plugin.MojoExecutionException
- If the source directory could not be scanned.protected void createTimestamp(GrammarInfo grammarInfo)
grammarInfo
- The grammar info describing the grammar file to process, must not be null
.protected void addCompileSourceRoot()