Package org.scijava.run
Interface CodeRunner
-
- All Superinterfaces:
Comparable<Prioritized>,Contextual,HandlerPlugin<Object>,HasPluginInfo,Identifiable,Locatable,Logged,Prioritized,RichPlugin,SciJavaPlugin,SingletonPlugin,Typed<Object>,TypedPlugin<Object>,Versioned
- All Known Implementing Classes:
AbstractCodeRunner,CommandCodeRunner,MainCodeRunner,ModuleCodeRunner,ScriptCodeRunner
public interface CodeRunner extends HandlerPlugin<Object>
A plugin which extends theRunService's execution handling. ACodeRunnerknows how to execute code of a certain form, such as themainmethod of a JavaClass, or anIdentifiableSciJava module.Code runner plugins discoverable at runtime must implement this interface and be annotated with @
Pluginwith attributePlugin.type()=CodeRunner.class. While it possible to create a class runner plugin merely by implementing this interface, it is encouraged to instead extendAbstractCodeRunner, for convenience.- Author:
- Curtis Rueden
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Class<Object>getType()Gets the type associated with the object.voidrun(Object code, Object... args)Executes the code identified by the given object, passing the specified arguments as inputs.voidrun(Object code, Map<String,Object> inputMap)Executes the code identified by the given object, passing the arguments in the specified map as inputs.-
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
-
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
-
Methods inherited from interface org.scijava.Locatable
getLocation
-
Methods inherited from interface org.scijava.Prioritized
compareTo, getPriority, setPriority
-
Methods inherited from interface org.scijava.plugin.RichPlugin
getIdentifier, log
-
Methods inherited from interface org.scijava.Versioned
getVersion
-
-
-
-
Method Detail
-
run
void run(Object code, Object... args) throws InvocationTargetException
Executes the code identified by the given object, passing the specified arguments as inputs.- Throws:
InvocationTargetException
-
run
void run(Object code, Map<String,Object> inputMap) throws InvocationTargetException
Executes the code identified by the given object, passing the arguments in the specified map as inputs.- Throws:
InvocationTargetException
-
-