public abstract class AbstractScriptEngine extends Object implements ScriptEngine
eval变体标准实施。
eval(Reader)
eval(String)
eval(String, Bindings)
eval(Reader, Bindings)
使用抽象方法
eval(Reader,ScriptContext)或eval(String, ScriptContext)
与SimpleScriptContext实施。
一SimpleScriptContext作为默认的ScriptContext的AbstractScriptEngine ..
| Modifier and Type | Field and Description |
|---|---|
protected ScriptContext |
context
这
AbstractScriptEngine默认
ScriptContext。
|
ARGV, ENGINE, ENGINE_VERSION, FILENAME, LANGUAGE, LANGUAGE_VERSION, NAME| Constructor and Description |
|---|
AbstractScriptEngine()
创建一个新实例abstractscriptengine使用
SimpleScriptContext作为其默认
ScriptContext。
|
AbstractScriptEngine(Bindings n)
使用指定的
Bindings在保护
context领域
ENGINE_SCOPE
Bindings创建一个新的实例。
|
| Modifier and Type | Method and Description |
|---|---|
Object |
eval(Reader reader)
eval(Reader)调用摘要
eval(Reader, ScriptContext)路过的
context字段的值。
|
Object |
eval(Reader reader, Bindings bindings)
eval(Reader, Bindings)调用摘要
eval(Reader, ScriptContext)方法,通过这一
ScriptContext的读者,其他
ENGINE_SCOPE是那些受保护的
context字段成员的相同范围的作家和绑定。
|
Object |
eval(String script)
同
eval(Reader)除了抽象的
eval(String, ScriptContext)使用。
|
Object |
eval(String script, Bindings bindings)
同
eval(Reader, Bindings)除了抽象的
eval(String, ScriptContext)使用。
|
Object |
get(String key)
获取在保护
context领域
ENGINE_SCOPE指定关键字的值。
|
Bindings |
getBindings(int scope)
返回与指定范围值在保护
context领域
Bindings。
|
ScriptContext |
getContext()
返回保护
context字段的值。
|
protected ScriptContext |
getScriptContext(Bindings nn)
返回一个
SimpleScriptContext。
|
void |
put(String key, Object value)
在受保护的
context领域
ENGINE_SCOPE
Bindings指定键指定的值集。
|
void |
setBindings(Bindings bindings, int scope)
在
context场对应的范围值
Bindings集。
|
void |
setContext(ScriptContext ctxt)
设置指定的
ScriptContext的保护
context字段的值。
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateBindings, eval, eval, getFactoryprotected ScriptContext context
AbstractScriptEngine默认
ScriptContext。
public AbstractScriptEngine()
SimpleScriptContext作为其默认
ScriptContext。
public AbstractScriptEngine(Bindings n)
Bindings在保护
context领域
ENGINE_SCOPE
Bindings创建一个新的实例。
n -指定
Bindings。
NullPointerException如果n是零。
public void setContext(ScriptContext ctxt)
ScriptContext的保护
context字段的值。
setContext 接口
ScriptEngine
ctxt -指定
ScriptContext。
NullPointerException -如果ctxt是空的。
public ScriptContext getContext()
context字段的值。
getContext 接口
ScriptEngine
context字段的值。
public Bindings getBindings(int scope)
context领域
Bindings。
getBindings 接口
ScriptEngine
scope -指定范围
Bindings。
IllegalArgumentException如果范围的值的类型的保护
context字段无效。
public void setBindings(Bindings bindings, int scope)
context场对应的范围值
Bindings集。
setBindings 接口
ScriptEngine
bindings -指定
Bindings。
scope -指定范围。
IllegalArgumentException如果范围的值的类型
context字段无效。
NullPointerException如果绑定无效的范围
ScriptContext.ENGINE_SCOPE
public void put(String key, Object value)
context领域
ENGINE_SCOPE
Bindings指定键指定的值集。
put 接口
ScriptEngine
key -指定键。
value -指定值。
NullPointerException如果关键是空的。
IllegalArgumentException如果关键是空的。
public Object get(String key)
context领域
ENGINE_SCOPE指定关键字的值。
get 接口
ScriptEngine
key -关键的值被返回
NullPointerException如果关键是空的。
IllegalArgumentException如果关键是空的。
public Object eval(Reader reader, Bindings bindings) throws ScriptException
eval(Reader, Bindings)调用摘要
eval(Reader, ScriptContext)方法,通过这一
ScriptContext的读者,其他
ENGINE_SCOPE是那些受保护的
context字段成员的相同范围的作家和绑定。指定的
Bindings代替的
context领域
ENGINE_SCOPE
Bindings。
eval 接口
ScriptEngine
reader -
Reader包含脚本的源。
bindings -
Bindings用于
ENGINE_SCOPE脚本执行时。
eval(Reader, ScriptContext)返回值
ScriptException -如果在脚本发生错误。
NullPointerException如果任一参数为空。
public Object eval(String script, Bindings bindings) throws ScriptException
eval(Reader, Bindings)除了抽象的
eval(String, ScriptContext)使用。
eval 接口
ScriptEngine
script -
String包含脚本的源。
bindings -
Bindings作为
ENGINE_SCOPE脚本执行时。
eval(String, ScriptContext)返回值
ScriptException -如果在脚本发生错误。
NullPointerException如果任一参数为空。
public Object eval(Reader reader) throws ScriptException
eval(Reader)调用摘要
eval(Reader, ScriptContext)路过的
context字段的值。
eval 接口
ScriptEngine
reader -
Reader包含脚本的源。
eval(Reader, ScriptContext)返回值
ScriptException -如果在脚本发生错误。
NullPointerException如果任一参数为空。
public Object eval(String script) throws ScriptException
eval(Reader)除了抽象的
eval(String, ScriptContext)使用。
eval 接口
ScriptEngine
script -
String包含脚本的源。
eval(String, ScriptContext)返回值
ScriptException -如果在脚本发生错误。
NullPointerException如果任一参数为空。
protected ScriptContext getScriptContext(Bindings nn)
SimpleScriptContext。的
SimpleScriptContext:
ENGINE_SCOPE BindingsBindings返回的摘要getGlobalScope方法为GLOBAL_SCOPEScriptEngine默认ScriptContextSimpleScriptContext返回此方法用于实现eval方法摘要
eval(Reader,Bindings)和
eval(String,Bindings)版本。
nn绑定使用的
ENGINE_SCOPE
SimpleScriptContext
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.