public abstract class TypedCmdLineTool<T> extends CmdLineTool
Modifier and Type | Field and Description |
---|---|
protected Class<T> |
type
variable to access the type of the generic parameter.
|
Modifier | Constructor and Description |
---|---|
protected |
TypedCmdLineTool(Class<T> sampleType)
Constructor with type parameters.
|
Modifier and Type | Method and Description |
---|---|
protected <A> String |
getBasicHelp(Class<A>... argProxyInterfaces) |
String |
getHelp()
Retrieves a description on how to use the tool.
|
abstract String |
getHelp(String format)
Retrieves a description on how to use the tool.
|
protected ObjectStreamFactory<T> |
getStreamFactory(String format)
Returns stream factory for the type of this tool for the
format . |
abstract void |
run(String format,
String[] args)
Executes the tool with the given parameters.
|
protected <A> void |
validateAllArgs(String[] args,
Class<A> argProxyInterface,
String format)
Validates arguments using parameters from
argProxyInterface and the parameters of the
format . |
protected void |
validateFactoryArgs(ObjectStreamFactory<T> factory,
String[] args)
Validates arguments for a format processed by the
factory . |
getBasicHelp, getName, getShortDescription, hasParams, validateAndParseParams
protected ObjectStreamFactory<T> getStreamFactory(String format)
format
.format
- data format nameprotected <A> void validateAllArgs(String[] args, Class<A> argProxyInterface, String format)
argProxyInterface
and the parameters of the
format
.A
- Aargs
- argumentsargProxyInterface
- interface with parameter descriptionsformat
- data format nameprotected void validateFactoryArgs(ObjectStreamFactory<T> factory, String[] args)
factory
.factory
- a stream factoryargs
- argumentsprotected <A> String getBasicHelp(Class<A>... argProxyInterfaces)
getBasicHelp
in class CmdLineTool
public String getHelp()
CmdLineTool
getHelp
in class CmdLineTool
public abstract void run(String format, String[] args)
format
- format to work withargs
- command line argumentsCopyright © 2015 The Apache Software Foundation. All rights reserved.