|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ModuleInfo
A ModuleInfo object encapsulates metadata about a particular Module
(but not a specific instance of it). In particular, it can report details on
the names and types of inputs and outputs.
A special class of implicit input parameters is available: when the
name
starts with a dot (e.g. .helloWorld
), no warning is
issued about an unmatched input.
Field Summary |
---|
Fields inherited from interface org.scijava.UIDetails |
---|
APPLICATION_MENU_ROOT |
Method Summary | ||
---|---|---|
boolean |
canCancel()
Gets whether the module condones cancellation. |
|
boolean |
canPreview()
Gets whether the module supports previews. |
|
boolean |
canRunHeadless()
Gets whether the module condones headless execution. |
|
Module |
createModule()
Instantiates the module described by this module info. |
|
String |
getDelegateClassName()
Gets the fully qualified name of the class containing the module's actual implementation. |
|
String |
getInitializer()
Gets the function that is called to initialize the module's values. |
|
ModuleItem<?> |
getInput(String name)
Gets the input item with the given name. |
|
|
getInput(String name,
Class<T> type)
Gets the input item with the given name and type. |
|
ModuleItem<?> |
getOutput(String name)
Gets the output item with the given name. |
|
|
getOutput(String name,
Class<T> type)
Gets the output item with the given name and type. |
|
Iterable<ModuleItem<?>> |
inputs()
Gets the list of input items. |
|
boolean |
isInteractive()
Gets whether the module is intended to be run interactively. |
|
Class<?> |
loadDelegateClass()
Loads the class containing the module's actual implementation. |
|
Iterable<ModuleItem<?>> |
outputs()
Gets the list of output items. |
|
void |
update(EventService eventService)
Notifies interested parties that the module info has been modified. |
Methods inherited from interface org.scijava.UIDetails |
---|
getIconPath, getMenuPath, getMenuRoot, getSelectionGroup, getTitle, isEnabled, isSelectable, isSelected, isVisible, setEnabled, setIconPath, setMenuPath, setMenuRoot, setSelectable, setSelected, setSelectionGroup, setVisible |
Methods inherited from interface org.scijava.BasicDetails |
---|
get, getDescription, getLabel, getName, is, set, setDescription, setLabel, setName |
Methods inherited from interface org.scijava.Prioritized |
---|
getPriority, setPriority |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Methods inherited from interface org.scijava.Validated |
---|
getProblems, isValid |
Method Detail |
---|
ModuleItem<?> getInput(String name)
<T> ModuleItem<T> getInput(String name, Class<T> type)
IllegalArgumentException
- if the given type is incompatible with the
named input itemModuleItem<?> getOutput(String name)
<T> ModuleItem<T> getOutput(String name, Class<T> type)
IllegalArgumentException
- if the given type is incompatible with the
named output itemIterable<ModuleItem<?>> inputs()
Iterable<ModuleItem<?>> outputs()
String getDelegateClassName()
createModule().getDelegateObject().getClass().getName()
, and hence
is also the class containing any callback methods specified by
ModuleItem.getCallback()
.
The nature of this method is implementation-specific; for example, a
CommandModule
will return the class name of its associated
Command
. For modules that are not commands, the result may be
something else.
If you are implementing this interface directly, a good rule of thumb is to
return the class name of the associated Module
(i.e., the same
value given by createModule().getClass().getName()
).
Class<?> loadDelegateClass() throws ClassNotFoundException
getDelegateClassName()
.
ClassNotFoundException
Instantiable.loadClass()
Module createModule() throws ModuleException
ModuleException
boolean isInteractive()
Runnable.run()
being called whenever any of the values change.
boolean canPreview()
Runnable.run()
. If this method returns false, then
calling Module.preview()
will have no effect.
boolean canCancel()
Module.cancel()
will
have no effect.
boolean canRunHeadless()
String getInitializer()
void update(EventService eventService)
For classes implementing this interface directly, this method should
publish a ModulesUpdatedEvent
to the event bus (see
AbstractModuleInfo.update(EventService)
for an example).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |