public abstract class AbstractModule extends Object implements Module
Module implementations.
By default, input and output values are stored in HashMaps.
| Constructor and Description |
|---|
AbstractModule() |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Performs necessary cleanup in response to cancellation of the module
execution.
|
Object |
getDelegateObject()
Gets the object containing the module's actual implementation.
|
Object |
getInput(String name)
Gets the value of the input with the given name.
|
Map<String,Object> |
getInputs()
Gets a table of input values.
|
Object |
getOutput(String name)
Gets the value of the output with the given name.
|
Map<String,Object> |
getOutputs()
Gets a table of output values.
|
void |
initialize()
Initializes the module.
|
boolean |
isInputResolved(String name)
Gets the resolution status of the input with the given name.
|
boolean |
isOutputResolved(String name)
Gets the resolution status of the output with the given name.
|
void |
preview()
Computes a preview of the module's execution results, if available.
|
void |
resolveInput(String name)
Marks the input with the given name as resolved.
|
void |
resolveOutput(String name)
Marks the output with the given name as resolved.
|
void |
setInput(String name,
Object value)
Sets the value of the input with the given name.
|
void |
setInputs(Map<String,Object> inputs)
Sets input values according to the given table.
|
void |
setOutput(String name,
Object value)
Sets the value of the output with the given name.
|
void |
setOutputs(Map<String,Object> outputs)
Sets output values according to the given table.
|
void |
unresolveInput(String name)
Marks the input with the given name as unresolved.
|
void |
unresolveOutput(String name)
Marks the output with the given name as unresolved.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetInfo, isResolved, setResolvedpublic void preview()
ModuleRunnable.run(). Not all modules support
previews.preview in interface ModuleModuleInfo.canPreview()public void cancel()
ModuleModule.preview() to undo
any changes made as a result of the preview.cancel in interface ModuleModuleInfo.canCancel()public void initialize()
throws MethodCallException
Module
First, the module's global initializer method (if any) is called, followed
by each individual ModuleItem initializer method (i.e.,
ModuleItem.initialize(Module)).
initialize in interface ModuleMethodCallExceptionModuleInfo.getInitializer(),
ModuleItem.initialize(Module)public Object getDelegateObject()
ModulegetInfo().getDelegateClassName(). This object must possess all
callback methods specified by ModuleItem.getCallback().
The nature of this method is implementation-specific; e.g., a
CommandModule will return its associated Command. For
modules that are not plugins, the result may be something else. If you are
implementing this interface directly, a good rule of thumb is to return
this.
getDelegateObject in interface Modulepublic Object getInput(String name)
Modulepublic Object getOutput(String name)
Modulepublic Map<String,Object> getInputs()
Modulepublic Map<String,Object> getOutputs()
ModulegetOutputs in interface Modulepublic void setInput(String name, Object value)
Modulepublic void setOutput(String name, Object value)
Modulepublic void setInputs(Map<String,Object> inputs)
Modulepublic void setOutputs(Map<String,Object> outputs)
ModulesetOutputs in interface Modulepublic boolean isInputResolved(String name)
ModuleisInputResolved in interface ModuleModule.resolveInput(String)public boolean isOutputResolved(String name)
ModuleisOutputResolved in interface ModuleModule.resolveOutput(String)public void resolveInput(String name)
Module
ModulePreprocessors in the module execution chain that populate
input values (e.g. InputHarvester plugins) will typically skip over
inputs which have already been resolved.
resolveInput in interface Modulepublic void resolveOutput(String name)
Module
ModulePostprocessors in the module execution chain that handle
output values (e.g. the DisplayPostprocessor) will typically skip
over outputs which have already been resolved.
resolveOutput in interface Modulepublic void unresolveInput(String name)
ModuleunresolveInput in interface ModuleModule.resolveInput(String)public void unresolveOutput(String name)
ModuleunresolveOutput in interface ModuleModule.resolveOutput(String)Copyright © 2015–2022 SciJava. All rights reserved.