Class ToolFacade

  • Direct Known Subclasses:
    JavaCC, JJDoc, JJTree, JTB

    abstract class ToolFacade
    extends java.lang.Object
    Provides a facade for the mojos to invoke JavaCC related tools.
    Version:
    $Id: ToolFacade.java 7758 2008-09-29 20:06:33Z bentmann $
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.apache.maven.plugin.logging.Log log
      The logger used to output diagnostic messages.
    • Constructor Summary

      Constructors 
      Constructor Description
      ToolFacade()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract int execute()
      Runs the tool using the previously set parameters.
      protected org.apache.maven.plugin.logging.Log getLog()
      Gets the logger used to output diagnostic messages.
      protected java.lang.String getToolName()
      Gets the name of the tool.
      void run()
      Runs the tool using the previously set parameters.
      void setLog​(org.apache.maven.plugin.logging.Log logger)
      Sets the logger used to output diagnostic messages.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • log

        private org.apache.maven.plugin.logging.Log log
        The logger used to output diagnostic messages.
    • Constructor Detail

      • ToolFacade

        ToolFacade()
    • Method Detail

      • setLog

        public void setLog​(org.apache.maven.plugin.logging.Log logger)
        Sets the logger used to output diagnostic messages.
        Parameters:
        logger - The logger used to output diagnostic messages, may be null.
      • getLog

        protected org.apache.maven.plugin.logging.Log getLog()
        Gets the logger used to output diagnostic messages.
        Returns:
        The logger used to output diagnostic messages, never null.
      • getToolName

        protected java.lang.String getToolName()
        Gets the name of the tool.
        Returns:
        The name of the tool, never null.
      • run

        public void run()
                 throws org.apache.maven.plugin.MojoExecutionException,
                        org.apache.maven.plugin.MojoFailureException
        Runs the tool using the previously set parameters.
        Throws:
        org.apache.maven.plugin.MojoExecutionException - If the tool could not be invoked.
        org.apache.maven.plugin.MojoFailureException - If the tool reported a non-zero exit code.
      • execute

        protected abstract int execute()
                                throws java.lang.Exception
        Runs the tool using the previously set parameters.
        Returns:
        The exit code of the tool, non-zero means failure.
        Throws:
        java.lang.Exception - If the tool could not be invoked.