ua.gradsoft.termware.jsr223
Class TermWareScriptEngine

java.lang.Object
  extended by javax.script.AbstractScriptEngine
      extended by ua.gradsoft.termware.jsr223.TermWareScriptEngine
All Implemented Interfaces:
Compilable, Invocable, ScriptEngine

public class TermWareScriptEngine
extends AbstractScriptEngine
implements Compilable, Invocable

JSR-223 Compatible scripting engine.

Author:
rssh

Field Summary
 
Fields inherited from class javax.script.AbstractScriptEngine
context
 
Fields inherited from interface javax.script.ScriptEngine
ARGV, ENGINE, ENGINE_VERSION, FILENAME, LANGUAGE, LANGUAGE_VERSION, NAME
 
Method Summary
 CompiledScript compile(Reader reader)
           
 CompiledScript compile(String text)
           
 Bindings createBindings()
           
 Object eval(Reader reader, ScriptContext ctx)
           
 Object eval(String text, ScriptContext ctx)
           
 ScriptEngineFactory getFactory()
           
 TermWareInstance getInstance()
           
<T> T
getInterface(Class<T> tClass)
           
<T> T
getInterface(Object o, Class<T> oClass)
           
 TermSystem getTermSystem()
           
 Object invokeFunction(String function, Object... args)
          form term function(arg1,...argN) and try to interpret one.
 Object invokeMethod(Object o, String m, Object... args)
           
 
Methods inherited from class javax.script.AbstractScriptEngine
eval, eval, eval, eval, get, getBindings, getContext, getScriptContext, put, setBindings, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFactory

public ScriptEngineFactory getFactory()
Specified by:
getFactory in interface ScriptEngine

eval

public Object eval(Reader reader,
                   ScriptContext ctx)
            throws ScriptException
Specified by:
eval in interface ScriptEngine
Throws:
ScriptException

eval

public Object eval(String text,
                   ScriptContext ctx)
            throws ScriptException
Specified by:
eval in interface ScriptEngine
Throws:
ScriptException

compile

public CompiledScript compile(Reader reader)
                       throws ScriptException
Specified by:
compile in interface Compilable
Throws:
ScriptException

compile

public CompiledScript compile(String text)
                       throws ScriptException
Specified by:
compile in interface Compilable
Throws:
ScriptException

createBindings

public Bindings createBindings()
Specified by:
createBindings in interface ScriptEngine

getInterface

public <T> T getInterface(Object o,
                          Class<T> oClass)
Specified by:
getInterface in interface Invocable

getInterface

public <T> T getInterface(Class<T> tClass)
Specified by:
getInterface in interface Invocable

invokeFunction

public Object invokeFunction(String function,
                             Object... args)
                      throws ScriptException,
                             NoSuchMethodException
form term function(arg1,...argN) and try to interpret one.

Specified by:
invokeFunction in interface Invocable
Throws:
ScriptException
NoSuchMethodException

invokeMethod

public Object invokeMethod(Object o,
                           String m,
                           Object... args)
                    throws ScriptException,
                           NoSuchMethodException
Specified by:
invokeMethod in interface Invocable
Throws:
ScriptException
NoSuchMethodException

getInstance

public TermWareInstance getInstance()

getTermSystem

public TermSystem getTermSystem()