Package com.googlecode.aviator.script
Class AviatorScriptEngine
java.lang.Object
javax.script.AbstractScriptEngine
com.googlecode.aviator.script.AviatorScriptEngine
- All Implemented Interfaces:
Compilable,Invocable,ScriptEngine
Aviator script engine
- Version:
- Author:
- libinsong1204@gmail.com, dennis(killme2008@gmail.com)
-
Field Summary
FieldsFields inherited from class javax.script.AbstractScriptEngine
contextFields inherited from interface javax.script.ScriptEngine
ARGV, ENGINE, ENGINE_VERSION, FILENAME, LANGUAGE, LANGUAGE_VERSION, NAME -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptioncreateBindings(Bindings parent) eval(Reader reader, ScriptContext context) eval(String script, ScriptContext context) getCachingKey(String script) <T> TgetInterface(Class<T> clasz) <T> TgetInterface(Object thiz, Class<T> clasz) invokeFunction(String name, Object... args) invokeMethod(Object thiz, String name, Object... args) booleanisCached()voidsetCached(boolean cached) Setting whether to cache the compiled script, default is true(caching).Methods inherited from class javax.script.AbstractScriptEngine
eval, eval, eval, eval, get, getBindings, getContext, getScriptContext, put, setBindings, setContext
-
Field Details
-
TEMP_VAR_GEN
-
-
Constructor Details
-
AviatorScriptEngine
public AviatorScriptEngine() -
AviatorScriptEngine
-
AviatorScriptEngine
-
-
Method Details
-
invokeMethod
public Object invokeMethod(Object thiz, String name, Object... args) throws ScriptException, NoSuchMethodException - Specified by:
invokeMethodin interfaceInvocable- Throws:
ScriptExceptionNoSuchMethodException
-
getEngine
-
invokeFunction
public Object invokeFunction(String name, Object... args) throws ScriptException, NoSuchMethodException - Specified by:
invokeFunctionin interfaceInvocable- Throws:
ScriptExceptionNoSuchMethodException
-
getInterface
- Specified by:
getInterfacein interfaceInvocable
-
getInterface
- Specified by:
getInterfacein interfaceInvocable
-
compile
- Specified by:
compilein interfaceCompilable- Throws:
ScriptException
-
getCachingKey
-
compile
- Specified by:
compilein interfaceCompilable- Throws:
ScriptException
-
createBindings
-
createBindings
- Specified by:
createBindingsin interfaceScriptEngine
-
eval
- Specified by:
evalin interfaceScriptEngine- Throws:
ScriptException
-
eval
- Specified by:
evalin interfaceScriptEngine- Throws:
ScriptException
-
getFactory
- Specified by:
getFactoryin interfaceScriptEngine
-
isCached
public boolean isCached() -
setCached
public void setCached(boolean cached) Setting whether to cache the compiled script, default is true(caching).- Parameters:
cached- true means enable caching.
-