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: AbstractAntlrMojo.java 13111 2010-11-16 22:16:36Z pgier $
Author:
Vincent Siveton
  • Field Details

    • sourceDirectory

      @Parameter(defaultValue="${basedir}/src/main/antlr") protected File sourceDirectory
      Specifies the Antlr directory containing grammar files.
    • project

      @Parameter(property="project", readonly=true) protected org.apache.maven.project.MavenProject project
      The Maven Project Object
    • outputDirectory

      @Parameter(defaultValue="${project.build.directory}/generated-sources/antlr") protected File outputDirectory
      Specifies the destination directory where Antlr should generate files.
      See Command Line Options
    • grammars

      @Parameter(property="grammars") protected String grammars
      Comma separated grammar file names or grammar pattern file names present in the sourceDirectory directory.
      See Command Line Options
    • grammarDefs

      @Parameter(property="grammarDefs") protected Grammar[] grammarDefs
      Grammar list presents in the sourceDirectory directory.
      See Command Line Options
      Example:
      <grammarDefs>
      <grammar>
      <name>myGrammar.g</name>
      <glib>mySuperGrammar.g;myOtherSuperGrammar.g</glib>
      </grammar>
      </grammarDefs>
  • Constructor Details

    • AbstractAntlrMojo

      public AbstractAntlrMojo()
  • Method Details

    • getSourceDirectory

      public File getSourceDirectory()
      Specified by:
      getSourceDirectory in interface Environment
    • getOutputDirectory

      public File getOutputDirectory()
      Specified by:
      getOutputDirectory in interface Environment
    • 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
      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 arguments)
      Add arguments to be included in Antlr call
      Parameters:
      arguments -
    • addArgIf

      protected static void addArgIf(List arguments, boolean b, String value)
      Convenience method to add an argument
      Parameters:
      arguments -
      b -
      value -