public class ParameterScriptProcessor extends Object implements ScriptProcessor
ScriptProcessor which 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 @Parameter annotation 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 of INPUT, OUTPUT, or BOTH.
<varName> - the name of the input or output variable.<type> - the Java Class of the variable, or
Object if none specified.<attr*> - an attribute key.<value*> - an attribute value.
See the @Parameter annotation 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 in Commands.
| Constructor and Description |
|---|
ParameterScriptProcessor() |
| Modifier and Type | Method and Description |
|---|---|
void |
begin(ScriptInfo scriptInfo) |
void |
end() |
String |
process(String line) |
public void begin(ScriptInfo scriptInfo)
begin in interface ScriptProcessorpublic String process(String line)
process in interface ScriptProcessorpublic void end()
end in interface ScriptProcessorCopyright © 2009–2023 SciJava. All rights reserved.