public class JavaScriptEngine extends FullSupportScriptEngine
ARGV, ENGINE, ENGINE_VERSION, FILENAME, LANGUAGE, LANGUAGE_VERSION, NAME
Constructor and Description |
---|
JavaScriptEngine() |
Modifier and Type | Method and Description |
---|---|
CompiledScript |
compile(Reader script) |
CompiledScript |
compile(String script) |
Bindings |
createBindings() |
Object |
eval(Reader reader) |
Object |
eval(Reader reader,
Bindings n) |
Object |
eval(Reader reader,
ScriptContext context) |
Object |
eval(String script) |
Object |
eval(String script,
Bindings n) |
Object |
eval(String script,
ScriptContext context) |
Object |
get(String key) |
Bindings |
getBindings(int scope) |
ScriptContext |
getContext() |
ScriptEngineFactory |
getFactory() |
<T> T |
getInterface(Class<T> clasz) |
<T> T |
getInterface(Object thiz,
Class<T> clasz) |
static JavaScriptEngine |
instance()
引擎实例
|
Object |
invokeFunction(String name,
Object... args) |
Object |
invokeMethod(Object thiz,
String name,
Object... args) |
void |
put(String key,
Object value) |
void |
setBindings(Bindings bindings,
int scope) |
void |
setContext(ScriptContext context) |
public static JavaScriptEngine instance()
public Object invokeMethod(Object thiz, String name, Object... args) throws ScriptException, NoSuchMethodException
invokeMethod
in interface Invocable
invokeMethod
in class FullSupportScriptEngine
ScriptException
NoSuchMethodException
public Object invokeFunction(String name, Object... args) throws ScriptException, NoSuchMethodException
invokeFunction
in interface Invocable
invokeFunction
in class FullSupportScriptEngine
ScriptException
NoSuchMethodException
public <T> T getInterface(Class<T> clasz)
getInterface
in interface Invocable
getInterface
in class FullSupportScriptEngine
public <T> T getInterface(Object thiz, Class<T> clasz)
getInterface
in interface Invocable
getInterface
in class FullSupportScriptEngine
public CompiledScript compile(String script) throws ScriptException
compile
in interface Compilable
compile
in class FullSupportScriptEngine
ScriptException
public CompiledScript compile(Reader script) throws ScriptException
compile
in interface Compilable
compile
in class FullSupportScriptEngine
ScriptException
public Object eval(String script, ScriptContext context) throws ScriptException
eval
in interface ScriptEngine
eval
in class FullSupportScriptEngine
ScriptException
public Object eval(Reader reader, ScriptContext context) throws ScriptException
eval
in interface ScriptEngine
eval
in class FullSupportScriptEngine
ScriptException
public Object eval(String script) throws ScriptException
eval
in interface ScriptEngine
eval
in class FullSupportScriptEngine
ScriptException
public Object eval(Reader reader) throws ScriptException
eval
in interface ScriptEngine
eval
in class FullSupportScriptEngine
ScriptException
public Object eval(String script, Bindings n) throws ScriptException
eval
in interface ScriptEngine
eval
in class FullSupportScriptEngine
ScriptException
public Object eval(Reader reader, Bindings n) throws ScriptException
eval
in interface ScriptEngine
eval
in class FullSupportScriptEngine
ScriptException
public void put(String key, Object value)
put
in interface ScriptEngine
put
in class FullSupportScriptEngine
public Object get(String key)
get
in interface ScriptEngine
get
in class FullSupportScriptEngine
public Bindings getBindings(int scope)
getBindings
in interface ScriptEngine
getBindings
in class FullSupportScriptEngine
public void setBindings(Bindings bindings, int scope)
setBindings
in interface ScriptEngine
setBindings
in class FullSupportScriptEngine
public Bindings createBindings()
createBindings
in interface ScriptEngine
createBindings
in class FullSupportScriptEngine
public ScriptContext getContext()
getContext
in interface ScriptEngine
getContext
in class FullSupportScriptEngine
public void setContext(ScriptContext context)
setContext
in interface ScriptEngine
setContext
in class FullSupportScriptEngine
public ScriptEngineFactory getFactory()
getFactory
in interface ScriptEngine
getFactory
in class FullSupportScriptEngine
Copyright © 2024. All rights reserved.