public interface ScriptLanguage extends ScriptEngineFactory, RichPlugin, SingletonPlugin
Every SciJava scripting language implements this interface, which is based on
JSR
223, Scripting for the Java Platform, included in Java 6 and later in the
javax.script
package. This ScriptLanguage
interface extends
ScriptEngineFactory
, meaning it can act as a JSR 223 Java scripting
language, while also providing additional functionality necessary for full
support within applications such as ImageJ. In particular, this interface
adds API for code generation of scripts to replicate SciJava Module
executions (i.e., for "script recording" of SciJava commands).
Script languages discoverable at runtime must implement this interface and be
annotated with @Plugin
with attribute Plugin.type()
=
ScriptLanguage
.class. While it possible to create a scripting
language adapter merely by implementing this interface, it is encouraged to
instead extend AbstractScriptLanguage
, for convenience.
Modifier and Type | Method and Description |
---|---|
default Object |
decode(Object object)
Performs any necessary conversion of an encoded object retrieved from the
language's script engine.
|
default AutoCompleter |
getAutoCompleter()
Gets a helper object capable of generating autocomplete suggestions for a
code fragment.
|
default String |
getEngineVersion() |
default List<String> |
getExtensions() |
default String |
getLanguageVersion() |
default String |
getMethodCallSyntax(String obj,
String m,
String... args) |
default List<String> |
getMimeTypes() |
default List<String> |
getNames() |
default String |
getOutputStatement(String toDisplay) |
default Object |
getParameter(String key) |
default String |
getProgram(String... statements) |
default boolean |
isCompiledLanguage()
True iff this language requires a compilation step.
|
getEngineName, getLanguageName, getScriptEngine
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
default boolean isCompiledLanguage()
default Object decode(Object object)
ScriptEngine.get(String)
default AutoCompleter getAutoCompleter()
default String getMethodCallSyntax(String obj, String m, String... args)
getMethodCallSyntax
in interface ScriptEngineFactory
default String getOutputStatement(String toDisplay)
getOutputStatement
in interface ScriptEngineFactory
default String getProgram(String... statements)
getProgram
in interface ScriptEngineFactory
default List<String> getExtensions()
getExtensions
in interface ScriptEngineFactory
default List<String> getNames()
getNames
in interface ScriptEngineFactory
default String getLanguageVersion()
getLanguageVersion
in interface ScriptEngineFactory
default List<String> getMimeTypes()
getMimeTypes
in interface ScriptEngineFactory
default Object getParameter(String key)
getParameter
in interface ScriptEngineFactory
default String getEngineVersion()
getEngineVersion
in interface ScriptEngineFactory
Copyright © 2015–2022 SciJava. All rights reserved.