Class TypedCmdLineTool<T,P>
java.lang.Object
opennlp.tools.cmdline.CmdLineTool
opennlp.tools.cmdline.TypedCmdLineTool<T,P>
- Direct Known Subclasses:
AbstractConverterTool, AbstractTypedParamTool
Base class for tools which support processing of samples of some type
T
coming from a stream of a certain format.-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTypedCmdLineTool(Class<T> sampleType) Constructor with type parameters. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetBasicHelp(Class<?>... argProxyInterfaces) getHelp()abstract Stringprotected ObjectStreamFactory<T, P> getStreamFactory(String format) Returns stream factory for the type of this tool for theformat.abstract voidExecutes the tool with the given parameters.protected <A> voidvalidateAllArgs(String[] args, Class<A> argProxyInterface, String format) Validates arguments using parameters fromargProxyInterfaceand the parameters of theformat.protected voidvalidateFactoryArgs(ObjectStreamFactory<T, P> factory, String[] args) Validates arguments for a format processed by thefactory.Methods inherited from class CmdLineTool
getBasicHelp, getName, getShortDescription, hasParams, validateAndParseParams
-
Field Details
-
type
-
-
Constructor Details
-
TypedCmdLineTool
-
-
Method Details
-
getStreamFactory
Returns stream factory for the type of this tool for theformat.- Parameters:
format- data format name- Returns:
- The
factoryfor the type of this tool for the format.
-
validateAllArgs
Validates arguments using parameters fromargProxyInterfaceand the parameters of theformat.- Type Parameters:
A- The generic type.- Parameters:
args- argumentsargProxyInterface- interface with parameter descriptionsformat- data format name
-
validateFactoryArgs
Validates arguments for a format processed by thefactory.- Parameters:
factory- Thefactoryto use.args- arguments
-
getBasicHelp
- Overrides:
getBasicHelpin classCmdLineTool
-
getHelp
- Specified by:
getHelpin classCmdLineTool- Returns:
- Retrieves a description on how to use the tool
-
run
-
getHelp
-