|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.task.TerminalInvoker
public class TerminalInvoker
Invokes Task objects in a way suitable for use from the main
method, using a command line interface.
The Task invoke methods are invoked and may throw any exception;
UsageException
and ExecutionException
will be treated
specially (a sanitised error message without stacktrace will be
presented to the user).
Constructor Summary | |
---|---|
TerminalInvoker(String toolname,
Map<String,Task> taskmap)
Creates a new invoker based on the given class with a given name. |
Method Summary | |
---|---|
static String |
getTaskUsage(Task task)
Returns a usage string for a given task. |
void |
invoke(String[] args)
Invokes a method from this TerminalInvoker's class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TerminalInvoker(String toolname, Map<String,Task> taskmap)
toolname
- the name of this tool, used for user messagestaskmap
- map of task names to Task objectsMethod Detail |
---|
public void invoke(String[] args) throws Exception
args
- the arguments identifying what method to call and what
arguments to pass to it
Exception
public static String getTaskUsage(Task task)
task
- task
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |