public class DefaultMutableModuleInfo extends AbstractModuleInfo implements MutableModuleInfo
MutableModuleInfo
implementation.
The Module
Class
given in the setModuleClass(Class)
method is used by getDelegateClassName()
as the delegate class name,
and instantiated using a no-argument constructor. As such, it is important
for downstream code to call the setModuleClass(Class)
method to
associate the module info with its module class prior to using the module
info for anything; the getDelegateClassName()
and
createModule()
methods will fail if the module class has not been
set.
APPLICATION_MENU_ROOT
Constructor and Description |
---|
DefaultMutableModuleInfo() |
Modifier and Type | Method and Description |
---|---|
void |
addInput(ModuleItem<?> input)
Adds an input to the list.
|
void |
addOutput(ModuleItem<?> output)
Adds an output to the list.
|
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.
|
Class<? extends Module> |
getModuleClass()
Gets the module class described by this
ModuleInfo . |
Class<?> |
loadDelegateClass()
Loads the class containing the module's actual implementation.
|
void |
removeInput(ModuleItem<?> input)
Removes an input from the list.
|
void |
removeOutput(ModuleItem<?> output)
Removes an output from the list.
|
void |
setModuleClass(Class<? extends Module> moduleClass)
Sets the module class described by this
ModuleInfo . |
canCancel, canPreview, canRunHeadless, clearParameters, getIdentifier, getInitializer, getInput, getInput, getLocation, getOutput, getOutput, getProblems, getTitle, getVersion, inputList, inputMap, inputs, isInteractive, isValid, outputList, outputMap, outputs, parseParameters, registerInput, registerOutput, update
compareTo, getIconPath, getMenuPath, getMenuRoot, getPriority, getSelectionGroup, isEnabled, isSelectable, isSelected, isVisible, setEnabled, setIconPath, setMenuPath, setMenuRoot, setPriority, setSelectable, setSelected, setSelectionGroup, setVisible, toString
get, getDescription, getLabel, getName, is, set, setDescription, setLabel, setName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
canCancel, canPreview, canRunHeadless, getInitializer, getInput, getInput, getOutput, getOutput, inputs, isInteractive, outputs, update
getIconPath, getMenuPath, getMenuRoot, getSelectionGroup, getTitle, isEnabled, isSelectable, isSelected, isVisible, setEnabled, setIconPath, setMenuPath, setMenuRoot, setSelectable, setSelected, setSelectionGroup, setVisible
get, getDescription, getLabel, is, set, setDescription, setLabel
compareTo, getPriority, setPriority
getProblems, isValid
public void setModuleClass(Class<? extends Module> moduleClass)
MutableModuleInfo
ModuleInfo
.setModuleClass
in interface MutableModuleInfo
public Class<? extends Module> getModuleClass()
MutableModuleInfo
ModuleInfo
.getModuleClass
in interface MutableModuleInfo
public void addInput(ModuleItem<?> input)
MutableModuleInfo
addInput
in interface MutableModuleInfo
public void addOutput(ModuleItem<?> output)
MutableModuleInfo
addOutput
in interface MutableModuleInfo
public void removeInput(ModuleItem<?> input)
MutableModuleInfo
removeInput
in interface MutableModuleInfo
public void removeOutput(ModuleItem<?> output)
MutableModuleInfo
removeOutput
in interface MutableModuleInfo
public String getDelegateClassName()
ModuleInfo
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()
).
getDelegateClassName
in interface ModuleInfo
public Class<?> loadDelegateClass()
ModuleInfo
ModuleInfo.getDelegateClassName()
.loadDelegateClass
in interface ModuleInfo
Instantiable.loadClass()
public Module createModule() throws ModuleException
ModuleInfo
createModule
in interface ModuleInfo
ModuleException
Copyright © 2009–2016 SciJava. All rights reserved.