Package org.codehaus.mojo.antlr
Class AbstractAntlrMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.codehaus.mojo.antlr.AbstractAntlrMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo,Environment
- Direct Known Subclasses:
AntlrHtmlReport,AntlrPlugin
public abstract class AbstractAntlrMojo extends org.apache.maven.plugin.AbstractMojo implements Environment
Base class with majority of Antlr functionalities.- Version:
- $Id$
- Author:
- Vincent Siveton
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractAntlrMojo.NoAntlrDependencyDefinedException
-
Field Summary
Fields Modifier and Type Field Description protected Grammar[]grammarDefsGrammar list presents in thesourceDirectorydirectory.protected StringgrammarsComma separated grammar file names or grammar pattern file names present in thesourceDirectorydirectory.protected FileoutputDirectorySpecifies the destination directory where Antlr should generate files.protected org.apache.maven.project.MavenProjectprojectThe Maven Project Objectprotected FilesourceDirectorySpecifies the Antlr directory containing grammar files.
-
Constructor Summary
Constructors Constructor Description AbstractAntlrMojo()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected static voidaddArgIf(List<String> arguments, boolean b, String value)Convenience method to add an argumentprotected abstract voidaddArgs(List<String> arguments)Add arguments to be included in Antlr callprotected voidexecuteAntlr()FilegetOutputDirectory()FilegetSourceDirectory()protected org.apache.maven.artifact.ArtifactlocateAntlrArtifact()protected voidperformGeneration(GenerationPlan plan, org.apache.maven.artifact.Artifact antlrArtifact)-
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
-
Methods inherited from interface org.codehaus.mojo.antlr.Environment
getLog
-
-
-
-
Field Detail
-
sourceDirectory
protected File sourceDirectory
Specifies the Antlr directory containing grammar files.
-
project
protected org.apache.maven.project.MavenProject project
The Maven Project Object
-
outputDirectory
protected File outputDirectory
Specifies the destination directory where Antlr should generate files.
See Command Line Options
-
grammars
protected String grammars
Comma separated grammar file names or grammar pattern file names present in thesourceDirectorydirectory.
See Command Line Options
-
grammarDefs
protected Grammar[] grammarDefs
Grammar list presents in thesourceDirectorydirectory.
See Command Line Options
Example:<grammarDefs>
<grammar>
<name>myGrammar.g</name>
<glib>mySuperGrammar.g;myOtherSuperGrammar.g</glib>
</grammar>
</grammarDefs>
-
-
Method Detail
-
getSourceDirectory
public File getSourceDirectory()
- Specified by:
getSourceDirectoryin interfaceEnvironment
-
getOutputDirectory
public File getOutputDirectory()
- Specified by:
getOutputDirectoryin interfaceEnvironment
-
executeAntlr
protected void executeAntlr() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
locateAntlrArtifact
protected final org.apache.maven.artifact.Artifact locateAntlrArtifact() throws AbstractAntlrMojo.NoAntlrDependencyDefinedException
-
performGeneration
protected void performGeneration(GenerationPlan plan, org.apache.maven.artifact.Artifact antlrArtifact) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
addArgs
protected abstract void addArgs(List<String> arguments)
Add arguments to be included in Antlr call- Parameters:
arguments-
-
-