Package org.scijava.script
Class ScriptModule
- java.lang.Object
-
- org.scijava.module.AbstractModule
-
- org.scijava.script.ScriptModule
-
- All Implemented Interfaces:
Runnable,Contextual,Module
public class ScriptModule extends AbstractModule implements Contextual
AModulewhich executes a script.- Author:
- Curtis Rueden, Johannes Schindelin
-
-
Field Summary
Fields Modifier and Type Field Description static StringRETURN_VALUE
-
Constructor Summary
Constructors Constructor Description ScriptModule(ScriptInfo info)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Contextcontext()Gets the application context to which the object belongs.ContextgetContext()Gets the application context to which the object belongs, or null ifContextual.setContext(Context)has not yet been called on this object.ScriptEnginegetEngine()Gets the script engine used to execute the script.ScriptInfogetInfo()Gets metadata about this module.ScriptLanguagegetLanguage()Deprecated.UseScriptInfo.getLanguage()instead.ObjectgetReturnValue()Gets the return value of the script.voidrun()voidsetContext(Context context)Sets the application context to which the object belongs.voidsetErrorWriter(Writer error)Sets the writer used to record the standard error stream.voidsetLanguage(ScriptLanguage scriptLanguage)Deprecated.UseScriptInfo.setLanguage(ScriptLanguage)instead.voidsetOutputWriter(Writer output)Sets the writer used to record the standard output stream.-
Methods inherited from class org.scijava.module.AbstractModule
cancel, getDelegateObject, getInput, getInputs, getOutput, getOutputs, initialize, isInputResolved, isOutputResolved, preview, resolveInput, resolveOutput, setInput, setInputs, setOutput, setOutputs, unresolveInput, unresolveOutput
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.scijava.module.Module
isResolved, setResolved
-
-
-
-
Field Detail
-
RETURN_VALUE
public static final String RETURN_VALUE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ScriptModule
public ScriptModule(ScriptInfo info)
-
-
Method Detail
-
setOutputWriter
public void setOutputWriter(Writer output)
Sets the writer used to record the standard output stream.
-
setErrorWriter
public void setErrorWriter(Writer error)
Sets the writer used to record the standard error stream.
-
getEngine
public ScriptEngine getEngine()
Gets the script engine used to execute the script.
-
getReturnValue
public Object getReturnValue()
Gets the return value of the script.
-
getInfo
public ScriptInfo getInfo()
Description copied from interface:ModuleGets metadata about this module.
-
context
public Context context()
Description copied from interface:ContextualGets the application context to which the object belongs.- Specified by:
contextin interfaceContextual- See Also:
Contextual.getContext()
-
getContext
public Context getContext()
Description copied from interface:ContextualGets the application context to which the object belongs, or null ifContextual.setContext(Context)has not yet been called on this object.- Specified by:
getContextin interfaceContextual- See Also:
Contextual.context()
-
setContext
public void setContext(Context context)
Description copied from interface:ContextualSets the application context to which the object belongs.Typically this method simply delegates to
Context.inject(Object), and should be called only once to populate the context. Most contextual objects do not support later alteration of the context, and will throwIllegalStateExceptionif this method is invoked again.- Specified by:
setContextin interfaceContextual- See Also:
Context.inject(Object)
-
getLanguage
@Deprecated public ScriptLanguage getLanguage()
Deprecated.UseScriptInfo.getLanguage()instead.
-
setLanguage
@Deprecated public void setLanguage(ScriptLanguage scriptLanguage)
Deprecated.UseScriptInfo.setLanguage(ScriptLanguage)instead.
-
-