org.scijava.script
Interface ScriptLanguage

All Superinterfaces:
Comparable<Prioritized>, Contextual, HasPluginInfo, Prioritized, RichPlugin, SciJavaPlugin, ScriptEngineFactory, SingletonPlugin
All Known Implementing Classes:
AbstractScriptLanguage, AdaptedScriptLanguage

public interface ScriptLanguage
extends ScriptEngineFactory, RichPlugin, SingletonPlugin

The base interface for scripting language adapters.

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.

Author:
Johannes Schindelin

Method Summary
 Object decode(Object object)
          Performs any necessary conversion of an encoded object retrieved from the language's script engine.
 boolean isCompiledLanguage()
          True iff this language requires a compilation step.
 
Methods inherited from interface javax.script.ScriptEngineFactory
getEngineName, getEngineVersion, getExtensions, getLanguageName, getLanguageVersion, getMethodCallSyntax, getMimeTypes, getNames, getOutputStatement, getParameter, getProgram, getScriptEngine
 
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
 
Methods inherited from interface org.scijava.Prioritized
getPriority, setPriority
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
 

Method Detail

isCompiledLanguage

boolean isCompiledLanguage()
True iff this language requires a compilation step.


decode

Object decode(Object object)
Performs any necessary conversion of an encoded object retrieved from the language's script engine.

See Also:
ScriptEngine.get(String)


Copyright © 2009–2015 SciJava. All rights reserved.