|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ScriptContext
See Javadoc of Java Scripting API
Field Summary | |
---|---|
static int |
ENGINE_SCOPE
defines an integer for the level of scope, ENGINE_SCOPE |
static int |
GLOBAL_SCOPE
defines an integer for the level of scope, GLOBAL_SCOPE |
Method Summary | |
---|---|
java.lang.Object |
getAttribute(java.lang.String name)
Retrieves the value of the getAttribute(String, int) for the lowest scope in which it returns a non-null value. |
java.lang.Object |
getAttribute(java.lang.String name,
int scope)
Retrieves the value of an attribute in the specified scope. |
int |
getAttributesScope(java.lang.String name)
Retrieves the lowest value of the scope for which the attribute is defined. |
Bindings |
getBindings(int scope)
Retrieves the Namespace instance associated with the gieve scope. |
java.io.Writer |
getErrorWriter()
|
java.io.Reader |
getReader()
|
java.util.List |
getScopes()
|
java.io.Writer |
getWriter()
Retrieves an instance of java.io.Writer which can be used by scripts to display their output. |
java.lang.Object |
removeAttribute(java.lang.String name,
int scope)
Removes the given attribute form the specified scope. |
void |
setAttribute(java.lang.String key,
java.lang.Object value,
int scope)
Associates a specified value with the specifed name in the specified scope. |
void |
setBindings(Bindings bindings,
int scope)
Associates the specified namespace with the specified scope. |
void |
setErrorWriter(java.io.Writer writer)
|
void |
setReader(java.io.Reader reader)
|
void |
setWriter(java.io.Writer writer)
|
Field Detail |
---|
static final int ENGINE_SCOPE
static final int GLOBAL_SCOPE
Method Detail |
---|
java.lang.Object getAttribute(java.lang.String name)
name
- the name of the attribute
java.lang.IllegalArgumentException
- if the name is nulljava.lang.Object getAttribute(java.lang.String name, int scope)
name
- the name of the attributescope
- the value of the scope
java.lang.IllegalArgumentException
- if the name is null or the
scope is invalidint getAttributesScope(java.lang.String name)
name
- the name of attribute
Bindings getBindings(int scope)
scope
- the level of the scope
java.io.Writer getWriter()
java.io.Writer getErrorWriter()
void setWriter(java.io.Writer writer)
void setErrorWriter(java.io.Writer writer)
java.io.Reader getReader()
void setReader(java.io.Reader reader)
java.lang.Object removeAttribute(java.lang.String name, int scope)
name
- the name of the attributescope
- the level of scope which inherit the attribute
java.lang.IllegalArgumentException
- if the name is null or if the
scope is invalidvoid setAttribute(java.lang.String key, java.lang.Object value, int scope)
key
- the name of the attributevalue
- the value of the attributescope
- the level of the scope
java.lang.IllegalArgumentException
- if the name is null or the
scope is invalidvoid setBindings(Bindings bindings, int scope)
bindings
- the namespace to be associated with the
specified level of scopescope
- the specified level of scope
java.lang.IllegalArgumentException
- if the scope is invalid
java.lang.NullPointerException
- if the bindings is null and the
scope is ScriptEngine.ENGINE_SCOPEjava.util.List getScopes()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |