java命名空间javax.script类simplescriptcontext的类成员方法:
globalscope定义及介绍
本文导语:
globalscope
protected bindings globalscope
此字段是全局范围 bindings。默认情况下,使用 null 值(表示没有全局范围)。可使用存取方法 setbindings 和 getbindings 来管理此字段。
simplescriptcontext
public simplescriptcontext()
setbindings
pub...
globalscope
protected bindings globalscope
- 此字段是全局范围 bindings。默认情况下,使用 null 值(表示没有全局范围)。可使用存取方法 setbindings 和 getbindings 来管理此字段。
simplescriptcontext
public simplescriptcontext()
setbindings
public void setbindings(bindings bindings,
int scope)
- 针对给定范围设置属性的
bindings。如果范围值为 engine_scope,则使用给定 bindings 替代 enginescope 字段。如果范围值为 global_scope,则使用给定 bindings 替换 globalscope 字段。
- 指定者:
- 接口
scriptcontext 中的 setbindings
- 参数:
bindings - 要设置的属性的 bindings。scope - 范围值,将在该范围中设置属性。
- 抛出:
illegalargumentexception - 如果 scope 无效。
nullpointerexception - 如果 scope 的值为 engine_scope 并且指定的 bindings 为 null。