|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.script.SimpleScriptContext
public class SimpleScriptContext
See Javadoc of Java Scripting API
Field Summary | |
---|---|
protected Bindings |
engineScope
namespace of the scope of level ENGINE_SCOPE |
protected Bindings |
globalScope
namespace of the scope of level GLOBAL_SCOPE |
Fields inherited from interface javax.script.ScriptContext |
---|
ENGINE_SCOPE, GLOBAL_SCOPE |
Constructor Summary | |
---|---|
SimpleScriptContext()
|
Method Summary | |
---|---|
java.lang.Object |
getAttribute(java.lang.String name)
Retrieves the value for 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 associated with specified name in the specified level of scope. |
int |
getAttributesScope(java.lang.String name)
Retrieves the lowest value of scopes for which the attribute is defined. |
Bindings |
getBindings(int scope)
Retrieves the Namespace instance associated with the specified level of 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 specified attribute form the specified level of scope. |
void |
setAttribute(java.lang.String name,
java.lang.Object value,
int scope)
Sets an attribute specified by the name in specified level of scope. |
void |
setBindings(Bindings namespace,
int scope)
Associates the specified namespace with specified level of scope. |
void |
setErrorWriter(java.io.Writer writer)
|
void |
setReader(java.io.Reader reader)
|
void |
setWriter(java.io.Writer writer)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Bindings globalScope
protected Bindings engineScope
Constructor Detail |
---|
public SimpleScriptContext()
Method Detail |
---|
public java.lang.Object getAttribute(java.lang.String name)
getAttribute
in interface ScriptContext
name
- the name of the attribute
public java.lang.Object getAttribute(java.lang.String name, int scope)
getAttribute
in interface ScriptContext
key
- the name of the attributescope
- the level of scope
public int getAttributesScope(java.lang.String name)
getAttributesScope
in interface ScriptContext
name
- the name of attribute
public Bindings getBindings(int scope)
getBindings
in interface ScriptContext
scope
- the level of the scope
public java.lang.Object removeAttribute(java.lang.String name, int scope)
removeAttribute
in interface ScriptContext
name
- the name of the attributescope
- the level of scope
public void setAttribute(java.lang.String name, java.lang.Object value, int scope)
setAttribute
in interface ScriptContext
key
- the name of the attributevalue
- the value of the attributescope
- the level of the scope
IllegalArguementException
- if the name is null scope is
invlaidpublic void setBindings(Bindings namespace, int scope)
setBindings
in interface ScriptContext
namespace
- the namespace to be associated with specified
level of scopescope
- the level of scopepublic java.util.List getScopes()
getScopes
in interface ScriptContext
public java.io.Reader getReader()
getReader
in interface ScriptContext
public void setReader(java.io.Reader reader)
setReader
in interface ScriptContext
public java.io.Writer getWriter()
ScriptContext
getWriter
in interface ScriptContext
public void setWriter(java.io.Writer writer)
setWriter
in interface ScriptContext
public java.io.Writer getErrorWriter()
getErrorWriter
in interface ScriptContext
public void setErrorWriter(java.io.Writer writer)
setErrorWriter
in interface ScriptContext
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |