public interface ModuleInfo extends UIDetails, Validated, Identifiable, Locatable, Versioned
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.
APPLICATION_MENU_ROOT
Modifier and Type | Method and Description |
---|---|
default boolean |
canCancel()
Gets whether the module condones cancellation.
|
default boolean |
canPreview()
Gets whether the module supports previews.
|
default 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.
|
default String |
getIdentifier()
Gets a string intended to function as an identifier for the object.
|
default 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.
|
<T> ModuleItem<T> |
getInput(String name,
Class<T> type)
Gets the input item with the given name and type.
|
default String |
getLocation()
Gets the URL string defining the object's location.
|
ModuleItem<?> |
getOutput(String name)
Gets the output item with the given name.
|
<T> ModuleItem<T> |
getOutput(String name,
Class<T> type)
Gets the output item with the given name and type.
|
default List<ValidityProblem> |
getProblems()
Gets the list of problems encountered while initializing the object.
|
default String |
getTitle()
Gets an appropriate title for the object, for use in a user interface.
|
default String |
getVersion()
Gets the version of the object.
|
Iterable<ModuleItem<?>> |
inputs()
Gets the list of input items.
|
default boolean |
isInteractive()
Gets whether the module is intended to be run interactively.
|
default boolean |
isValid()
Gets whether the object is completely valid (i.e., no problems during
initialization).
|
Class<?> |
loadDelegateClass()
Loads the class containing the module's actual implementation.
|
Iterable<ModuleItem<?>> |
outputs()
Gets the list of output items.
|
default void |
update(EventService eventService)
Notifies interested parties that the module info has been modified.
|
compareTo, getIconPath, getMenuPath, getMenuRoot, getSelectionGroup, isEnabled, isSelectable, isSelected, isVisible, setEnabled, setIconPath, setMenuPath, setMenuRoot, setSelectable, setSelected, setSelectionGroup, setVisible
get, getDescription, getLabel, is, set, setDescription, setLabel
getPriority, setPriority
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
default boolean isInteractive()
Runnable.run()
being called whenever any of the values change.default boolean canPreview()
Runnable.run()
. If this method returns false, then
calling Module.preview()
will have no effect.default boolean canCancel()
Module.cancel()
will
have no effect.default boolean canRunHeadless()
default String getInitializer()
default void update(EventService eventService)
default String getTitle()
UIDetails
default boolean isValid()
Validated
default List<ValidityProblem> getProblems()
Validated
getProblems
in interface Validated
Validated.isValid()
returning true.default String getIdentifier()
Identifiable
getIdentifier
in interface Identifiable
default String getLocation()
Locatable
getLocation
in interface Locatable
default String getVersion()
Versioned
getVersion
in interface Versioned
Copyright © 2015–2022 SciJava. All rights reserved.