Package org.scijava.script.process
Class ParameterScriptProcessor
- java.lang.Object
-
- org.scijava.script.process.ParameterScriptProcessor
-
- All Implemented Interfaces:
SciJavaPlugin,ScriptProcessor
public class ParameterScriptProcessor extends Object implements ScriptProcessor
AScriptProcessorwhich parses the script's input and output parameters from the script header.SciJava's scripting framework supports specifying @
Parameter-style inputs and outputs in a preamble. The format is a simplified version of the Java @Parameterannotation syntax. The following syntaxes are supported:#@ <type> <varName>#@ <type>(<attr1>=<value1>, ..., <attrN>=<valueN>) <varName>#@<IOType> <varName>#@<IOType> <type> <varName>#@<IOType>(<attr1>=<value1>, ..., <attrN>=<valueN>) <type> <varName>
Where:
#@- signals a special script processing instruction, so that the parameter line is ignored by the script engine itself.<IOType>- one ofINPUT,OUTPUT, orBOTH.<varName>- the name of the input or output variable.<type>- the JavaClassof the variable, orObjectif none specified.<attr*>- an attribute key.<value*>- an attribute value.
See the @
Parameterannotation for a list of valid attributes.Here are a few examples:
#@Dataset dataset#@double(type=OUTPUT) result#@both ImageDisplay display#@input(persist=false, visibility=INVISIBLE) boolean verbose#@output thing
Parameters will be parsed and filled just like @
Parameter-annotated fields inCommands.- Author:
- Curtis Rueden
-
-
Constructor Summary
Constructors Constructor Description ParameterScriptProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbegin(ScriptInfo scriptInfo)voidend()Stringprocess(String line)
-
-
-
Method Detail
-
begin
public void begin(ScriptInfo scriptInfo)
- Specified by:
beginin interfaceScriptProcessor
-
process
public String process(String line)
- Specified by:
processin interfaceScriptProcessor
-
end
public void end()
- Specified by:
endin interfaceScriptProcessor
-
-