Class AbstractJavaTool<Request extends JavaToolRequest>

  • Type Parameters:
    Request -
    All Implemented Interfaces:
    JavaTool<Request>, org.codehaus.plexus.logging.LogEnabled

    public abstract class AbstractJavaTool<Request extends JavaToolRequest>
    extends org.codehaus.plexus.logging.AbstractLogEnabled
    implements JavaTool<Request>
    Abstract implementation of a JavaTool.
    Since:
    0.5
    Author:
    Tony Chemit
    • Constructor Detail

      • AbstractJavaTool

        protected AbstractJavaTool​(java.lang.String javaToolName)
        Parameters:
        javaToolName - The name of the java tool.
    • Method Detail

      • createCommandLine

        protected abstract Commandline createCommandLine​(Request request,
                                                         java.lang.String javaToolFileLocation)
                                                  throws JavaToolException
        Create the command line object given the request.
        Parameters:
        request - User request on the java tool
        javaToolFileLocation - Location of the java tool file to use
        Returns:
        the command line
        Throws:
        JavaToolException - if could not create the command line from the request
      • getJavaToolName

        public java.lang.String getJavaToolName()
        Return the name of the java tool. This is exactly the name (without his extension) of the executable to find in the jdk/bin directory.

        For example: jarsigner, keytool, javadoc, ...

        Specified by:
        getJavaToolName in interface JavaTool<Request extends JavaToolRequest>
        Returns:
        the name of the java tool.
      • setToolchain

        public void setToolchain​(java.lang.Object toolchain)
        Set an optional tool chain to find out the java tool executable location.
        Specified by:
        setToolchain in interface JavaTool<Request extends JavaToolRequest>
        Parameters:
        toolchain - optional tool chain to find out the java tool executable location. To avoid direct dependency on Maven core, this parameter is an Object that will be used as Toolchain through reflection
      • createSystemInputStream

        protected java.io.InputStream createSystemInputStream()
        Returns:
        InputStream
      • createResult

        protected JavaToolResult createResult()
        Returns:
        The JavaToolResult.
      • findJavaToolExecutable

        protected java.lang.String findJavaToolExecutable()
        Returns:
        The location of the java tool executable.