|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unihalle.informatik.Alida.tools.ALDOpRunner
public class ALDOpRunner
Generic commandline interface to run an Alida operator. The operator needs to be annotated to allows execution mode CMDLINE.
Reading of IN and INOUT parameters and writing of OUT and INOUT parameters
is accomplished using the interface ALDDataIOCmdline
in conjunction
with ALDDataIOManagerCmdline
.
For each parameter which should be read or written accoring to its
annotated direction
, a name=value pair has to be given as argument.
If the flag --donotrun
or -n
is given, only the parameters of the operator
and there details will be printed but the operator is not invoked.
If the flag --verbose
or -v
the interface of the
operator will be printed to stdout (and potentially further information).
Field Summary | |
---|---|
private java.lang.String[] |
args
command line arguments. |
private boolean |
debug
debug flag for additional debuging information. |
private boolean |
donotrun
If true, the operator will not be invoked but only its interface printed to stdout. |
private java.util.HashMap<java.lang.String,java.lang.String> |
nameParameterMap
Hashmap to collect parameter name as given on command line and matching parameter name. |
private java.util.HashMap<java.lang.String,java.lang.String> |
nameValueMap
Hashmap to collect parameter name as given on command line and correspnding value string |
private ALDOperator |
op
The operator to be invoked. |
private boolean |
useRegEx
If true, matching of operator name from commandline to the annoteated ALDOperators uses regular expression matching, otherwise exact substring matching |
private boolean |
verbose
verbose flag to outout additional information to stdout. |
Constructor Summary | |
---|---|
ALDOpRunner(java.lang.String[] args)
Construct a ALDOpRunner using args |
Method Summary | |
---|---|
private java.util.LinkedList<java.lang.String> |
findOperators(java.lang.String opNamePattern)
find operator with given pattern among all annotated ALDOperators |
private boolean |
isExactSubstring(java.lang.String substr,
java.lang.String str)
return true, if substr is a exact substring of str |
static void |
main(java.lang.String[] args)
Main routine of ALDOpRunner , see usage. |
private static void |
printUsage()
Print short usage to stderr. |
private void |
printUsageVerbose()
Print verbose usage to stderr. |
private void |
readParameterValues(int firstIndex)
Read all IN and INOUT parameters specified on the command line. |
void |
runIt()
This method does the complete work to scan arguments, read and write parameters and runOp the operator. |
private void |
validateParameternames(int firstIndex)
Validate the parametername=valuestring pairs with respect to syntax
and validate the existance of the parameter in the operator interface. |
private void |
writeParameterValues(int firstIndex)
Write all OUT and INOUT parameters specified on the command line. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String[] args
private boolean debug
private boolean donotrun
private java.util.HashMap<java.lang.String,java.lang.String> nameParameterMap
private java.util.HashMap<java.lang.String,java.lang.String> nameValueMap
private ALDOperator op
private boolean useRegEx
private boolean verbose
Constructor Detail |
---|
public ALDOpRunner(java.lang.String[] args)
ALDOpRunner
using args
args
- command line argumentsMethod Detail |
---|
private java.util.LinkedList<java.lang.String> findOperators(java.lang.String opNamePattern)
private boolean isExactSubstring(java.lang.String substr, java.lang.String str)
substr
is a exact substring of str
public static void main(java.lang.String[] args)
ALDOpRunner
, see usage.
args
- command line argumentsprivate static void printUsage()
private void printUsageVerbose()
private void readParameterValues(int firstIndex)
firstIndex
- index of first parametername in argspublic void runIt()
runOp
the operator.
private void validateParameternames(int firstIndex)
parametername=valuestring
pairs with respect to syntax
and validate the existance of the parameter in the operator interface.
firstIndex
- index of first parametername in argsprivate void writeParameterValues(int firstIndex)
firstIndex
- index of first parametername in args
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |