Package org.armedbear.lisp.scripting
Class AbclScriptEngine
- java.lang.Object
-
- javax.script.AbstractScriptEngine
-
- org.armedbear.lisp.scripting.AbclScriptEngine
-
- All Implemented Interfaces:
javax.script.Compilable,javax.script.Invocable,javax.script.ScriptEngine
public class AbclScriptEngine extends javax.script.AbstractScriptEngine implements javax.script.Invocable, javax.script.Compilable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classAbclScriptEngine.AbclCompiledScript
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbclScriptEngine()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.script.CompiledScriptcompile(java.io.Reader script)javax.script.CompiledScriptcompile(java.lang.String script)LispObjectcompileAndLoad(java.lang.String filespec)LispObjectcompileFile(java.lang.String filespec)javax.script.BindingscreateBindings()static java.lang.Stringescape(java.lang.String s)java.lang.Objecteval(java.io.Reader code, javax.script.ScriptContext ctx)java.lang.Objecteval(java.lang.String code, javax.script.ScriptContext ctx)FunctionfindFunction(java.lang.String name)SymbolfindSymbol(java.lang.String name)SymbolfindSymbol(java.lang.String name, java.lang.String pkg)static booleanfunctionp(LispObject obj)javax.script.ScriptEngineFactorygetFactory()<T> TgetInterface(java.lang.Class<T> clasz)<T> TgetInterface(java.lang.Object thiz, java.lang.Class<T> clasz)InterpretergetInterpreter()java.lang.ObjectinvokeFunction(java.lang.String name, java.lang.Object... args)java.lang.ObjectinvokeMethod(java.lang.Object thiz, java.lang.String name, java.lang.Object... args)static booleanisCompiled(java.lang.String filespec)JavaObjectjsetq(java.lang.String symbol, java.lang.Object value)LispObjectload(java.lang.String filespec)LispObjectload(java.lang.String filespec, boolean compileIfNecessary)LispObjectload(Stream stream)LispObjectloadFromClasspath(java.lang.String classpathResource)voidsetInterpreter(Interpreter interpreter)voidsetStandardInput(java.io.InputStream stream)voidsetStandardInput(java.io.InputStream stream, LispThread thread)
-
-
-
Method Detail
-
getInterpreter
public Interpreter getInterpreter()
-
setStandardInput
public void setStandardInput(java.io.InputStream stream, LispThread thread)
-
setStandardInput
public void setStandardInput(java.io.InputStream stream)
-
setInterpreter
public void setInterpreter(Interpreter interpreter)
-
escape
public static java.lang.String escape(java.lang.String s)
-
loadFromClasspath
public LispObject loadFromClasspath(java.lang.String classpathResource)
-
load
public LispObject load(Stream stream)
-
load
public LispObject load(java.lang.String filespec)
-
load
public LispObject load(java.lang.String filespec, boolean compileIfNecessary)
-
isCompiled
public static boolean isCompiled(java.lang.String filespec)
-
compileFile
public LispObject compileFile(java.lang.String filespec)
-
compileAndLoad
public LispObject compileAndLoad(java.lang.String filespec)
-
functionp
public static boolean functionp(LispObject obj)
-
jsetq
public JavaObject jsetq(java.lang.String symbol, java.lang.Object value)
-
findSymbol
public Symbol findSymbol(java.lang.String name, java.lang.String pkg)
-
findSymbol
public Symbol findSymbol(java.lang.String name)
-
findFunction
public Function findFunction(java.lang.String name)
-
createBindings
public javax.script.Bindings createBindings()
- Specified by:
createBindingsin interfacejavax.script.ScriptEngine
-
eval
public java.lang.Object eval(java.lang.String code, javax.script.ScriptContext ctx) throws javax.script.ScriptException- Specified by:
evalin interfacejavax.script.ScriptEngine- Throws:
javax.script.ScriptException
-
eval
public java.lang.Object eval(java.io.Reader code, javax.script.ScriptContext ctx) throws javax.script.ScriptException- Specified by:
evalin interfacejavax.script.ScriptEngine- Throws:
javax.script.ScriptException
-
getFactory
public javax.script.ScriptEngineFactory getFactory()
- Specified by:
getFactoryin interfacejavax.script.ScriptEngine
-
getInterface
public <T> T getInterface(java.lang.Class<T> clasz)
- Specified by:
getInterfacein interfacejavax.script.Invocable
-
getInterface
public <T> T getInterface(java.lang.Object thiz, java.lang.Class<T> clasz)- Specified by:
getInterfacein interfacejavax.script.Invocable
-
invokeFunction
public java.lang.Object invokeFunction(java.lang.String name, java.lang.Object... args) throws javax.script.ScriptException, java.lang.NoSuchMethodException- Specified by:
invokeFunctionin interfacejavax.script.Invocable- Throws:
javax.script.ScriptExceptionjava.lang.NoSuchMethodException
-
invokeMethod
public java.lang.Object invokeMethod(java.lang.Object thiz, java.lang.String name, java.lang.Object... args) throws javax.script.ScriptException, java.lang.NoSuchMethodException- Specified by:
invokeMethodin interfacejavax.script.Invocable- Throws:
javax.script.ScriptExceptionjava.lang.NoSuchMethodException
-
compile
public javax.script.CompiledScript compile(java.lang.String script) throws javax.script.ScriptException- Specified by:
compilein interfacejavax.script.Compilable- Throws:
javax.script.ScriptException
-
compile
public javax.script.CompiledScript compile(java.io.Reader script) throws javax.script.ScriptException- Specified by:
compilein interfacejavax.script.Compilable- Throws:
javax.script.ScriptException
-
-