javax.script
Interface ScriptContext

All Known Subinterfaces:
HttpScriptContext
All Known Implementing Classes:
SimpleScriptContext

public interface ScriptContext

Context information from an engine to the bindings.


Field Summary
static int ENGINE_SCOPE
           
static int GLOBAL_SCOPE
           
 
Method Summary
 java.lang.Object getAttribute(java.lang.String name)
          Gets an attribute in the lowest scope.
 java.lang.Object getAttribute(java.lang.String name, int scope)
          Gets an attribute in a scope.
 int getAttributesScope(java.lang.String name)
          Gets an attribute in the lowest scope.
 Bindings getBindings(int scope)
          Returns the bindings associated with a scope.
 java.io.Writer getErrorWriter()
          Returns the script's error writer.
 java.io.Reader getReader()
          Returns a reader for input.
 java.util.List<java.lang.Integer> getScopes()
          Returns the available scopes.
 java.io.Writer getWriter()
          Returns the script's writer.
 java.lang.Object removeAttribute(java.lang.String name, int scope)
          Gets an attribute in a scope.
 void setAttribute(java.lang.String name, java.lang.Object value, int scope)
          Sets an attribute in a scope.
 void setBindings(Bindings bindings, int scope)
          Associates a bindings with a scope.
 void setErrorWriter(java.io.Writer writer)
          Returns the script's error writer.
 void setReader(java.io.Reader reader)
          Sets a reader for input.
 void setWriter(java.io.Writer writer)
          Sets the script's writer.
 

Field Detail

ENGINE_SCOPE

static final int ENGINE_SCOPE
See Also:
Constant Field Values

GLOBAL_SCOPE

static final int GLOBAL_SCOPE
See Also:
Constant Field Values
Method Detail

setBindings

void setBindings(Bindings bindings,
                 int scope)
Associates a bindings with a scope.

Parameters:
bindings - the bindings to assign
scope - the scope code

getBindings

Bindings getBindings(int scope)
Returns the bindings associated with a scope.


setAttribute

void setAttribute(java.lang.String name,
                  java.lang.Object value,
                  int scope)
Sets an attribute in a scope.


getAttribute

java.lang.Object getAttribute(java.lang.String name,
                              int scope)
Gets an attribute in a scope.


removeAttribute

java.lang.Object removeAttribute(java.lang.String name,
                                 int scope)
Gets an attribute in a scope.


getAttribute

java.lang.Object getAttribute(java.lang.String name)
Gets an attribute in the lowest scope.


getAttributesScope

int getAttributesScope(java.lang.String name)
Gets an attribute in the lowest scope.


getReader

java.io.Reader getReader()
Returns a reader for input.


setReader

void setReader(java.io.Reader reader)
Sets a reader for input.


getWriter

java.io.Writer getWriter()
Returns the script's writer.


setWriter

void setWriter(java.io.Writer writer)
Sets the script's writer.


getErrorWriter

java.io.Writer getErrorWriter()
Returns the script's error writer.


setErrorWriter

void setErrorWriter(java.io.Writer writer)
Returns the script's error writer.


getScopes

java.util.List<java.lang.Integer> getScopes()
Returns the available scopes.