public class LineInvoker extends Object
LineTableEnvironment
.Constructor and Description |
---|
LineInvoker(String toolName,
ObjectFactory<Task> taskFactory)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected LineTableEnvironment |
createEnvironment()
Creates a LineTableEnvironment for use with this invoker.
|
protected void |
execute(Executable exec)
Executes the given executable.
|
static String |
getParamHelp(TableEnvironment env,
String taskName,
Parameter<?> param)
Returns a help string for a parameter of one of the tasks known
to this application.
|
static String |
getPrefixedParameterUsage(Parameter<?>[] params,
String prefix)
Returns a usage string for a set of parameters,
prefixed by a given string.
|
static String |
getStackSummary(Throwable error)
Returns a truncated version of a stack trace for user consumption.
|
static String |
getUnusedWarning(String[] unused)
Returns a warning string appropriate for the case when one or more
words on the command line are never used by a task.
|
int |
invoke(String[] args,
Runnable loggedConfig)
Invokes one of the known tasks given a string of command-line words.
|
public LineInvoker(String toolName, ObjectFactory<Task> taskFactory)
toolName
- name of the overall applicationtaskFactory
- factory which can create the tasks known to
the applicationpublic int invoke(String[] args, Runnable loggedConfig)
args
string will typically come straight out of
a static main()
method.
A callback may be supplied to perform configuration that has to
be done after logging configuration - presumably because it
does some logging itself. It is executed synchronously.args
- argument listloggedConfig
- callback for configuration to be done after
logging configuration (may be null)protected LineTableEnvironment createEnvironment()
protected void execute(Executable exec) throws TaskException, IOException
Executable.execute()
method, but subclasses can override it to do something different.exec
- executableTaskException
IOException
public static String getStackSummary(Throwable error)
error
- exception to summarisepublic static String getPrefixedParameterUsage(Parameter<?>[] params, String prefix)
params
- parameter arrayprefix
- string to prepend to the first linepublic static String getParamHelp(TableEnvironment env, String taskName, Parameter<?> param)
env
- execution environmenttaskName
- task nickname - may be null if heading is not requiredparam
- parameter for which usage information is requiredCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.