public abstract class AbstractJavaTool<Request extends JavaToolRequest> extends AbstractLogEnabled implements JavaTool<Request>
JavaTool
.Modifier | Constructor and Description |
---|---|
protected |
AbstractJavaTool(String javaToolName) |
Modifier and Type | Method and Description |
---|---|
protected abstract Commandline |
createCommandLine(Request request,
String javaToolFile)
Create the commandline object given the request.
|
protected JavaToolResult |
createResult() |
protected StreamConsumer |
createSystemErrorStreamConsumer(Request request) |
protected InputStream |
createSystemInputStream() |
protected StreamConsumer |
createSystemOutStreamConsumer(Request request) |
JavaToolResult |
execute(Request request) |
protected JavaToolResult |
executeCommandLine(Commandline cli,
Request request) |
protected String |
findJavaToolExecutable() |
String |
getJavaToolName()
Return the name of the java tool.
|
void |
setToolchain(org.apache.maven.toolchain.Toolchain toolchain)
Set an optional tool chain to find out the java tool executable location.
|
protected AbstractJavaTool(String javaToolName)
protected abstract Commandline createCommandLine(Request request, String javaToolFile) throws JavaToolException
request
- User request on the java tooljavaToolFile
- Location of the java tool file to useJavaToolException
- if could not create the command line from the requestpublic String getJavaToolName()
jdk/bin
directory.
For example: jarsigner, keytool, javadoc, ...
getJavaToolName
in interface JavaTool<Request extends JavaToolRequest>
public void setToolchain(org.apache.maven.toolchain.Toolchain toolchain)
setToolchain
in interface JavaTool<Request extends JavaToolRequest>
toolchain
- optional tool chain to find out the java tool executable location.public JavaToolResult execute(Request request) throws JavaToolException
JavaToolException
protected InputStream createSystemInputStream()
protected JavaToolResult executeCommandLine(Commandline cli, Request request)
protected StreamConsumer createSystemErrorStreamConsumer(Request request)
protected StreamConsumer createSystemOutStreamConsumer(Request request)
protected JavaToolResult createResult()
protected String findJavaToolExecutable()
Copyright © 2002–2014 The Apache Software Foundation. All rights reserved.