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 InvocableinvokeMethod in class FullSupportScriptEngineScriptExceptionNoSuchMethodExceptionpublic Object invokeFunction(String name, Object... args) throws ScriptException, NoSuchMethodException
invokeFunction in interface InvocableinvokeFunction in class FullSupportScriptEngineScriptExceptionNoSuchMethodExceptionpublic <T> T getInterface(Class<T> clasz)
getInterface in interface InvocablegetInterface in class FullSupportScriptEnginepublic <T> T getInterface(Object thiz, Class<T> clasz)
getInterface in interface InvocablegetInterface in class FullSupportScriptEnginepublic CompiledScript compile(String script) throws ScriptException
compile in interface Compilablecompile in class FullSupportScriptEngineScriptExceptionpublic CompiledScript compile(Reader script) throws ScriptException
compile in interface Compilablecompile in class FullSupportScriptEngineScriptExceptionpublic Object eval(String script, ScriptContext context) throws ScriptException
eval in interface ScriptEngineeval in class FullSupportScriptEngineScriptExceptionpublic Object eval(Reader reader, ScriptContext context) throws ScriptException
eval in interface ScriptEngineeval in class FullSupportScriptEngineScriptExceptionpublic Object eval(String script) throws ScriptException
eval in interface ScriptEngineeval in class FullSupportScriptEngineScriptExceptionpublic Object eval(Reader reader) throws ScriptException
eval in interface ScriptEngineeval in class FullSupportScriptEngineScriptExceptionpublic Object eval(String script, Bindings n) throws ScriptException
eval in interface ScriptEngineeval in class FullSupportScriptEngineScriptExceptionpublic Object eval(Reader reader, Bindings n) throws ScriptException
eval in interface ScriptEngineeval in class FullSupportScriptEngineScriptExceptionpublic void put(String key, Object value)
put in interface ScriptEngineput in class FullSupportScriptEnginepublic Object get(String key)
get in interface ScriptEngineget in class FullSupportScriptEnginepublic Bindings getBindings(int scope)
getBindings in interface ScriptEnginegetBindings in class FullSupportScriptEnginepublic void setBindings(Bindings bindings, int scope)
setBindings in interface ScriptEnginesetBindings in class FullSupportScriptEnginepublic Bindings createBindings()
createBindings in interface ScriptEnginecreateBindings in class FullSupportScriptEnginepublic ScriptContext getContext()
getContext in interface ScriptEnginegetContext in class FullSupportScriptEnginepublic void setContext(ScriptContext context)
setContext in interface ScriptEnginesetContext in class FullSupportScriptEnginepublic ScriptEngineFactory getFactory()
getFactory in interface ScriptEnginegetFactory in class FullSupportScriptEngineCopyright © 2025. All rights reserved.