public class ScriptContextImpl extends Object implements ScriptContext
ENGINE_SCOPE, GLOBAL_SCOPE
Constructor and Description |
---|
ScriptContextImpl()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addScope(int scope)
Add a scope to the context.
|
Object |
getAttribute(String name) |
Object |
getAttribute(String name,
int scope) |
int |
getAttributesScope(String name) |
Bindings |
getBindings(int scope) |
Writer |
getErrorWriter() |
Reader |
getReader() |
List<Integer> |
getScopes()
This returns the list of scopes in the order they are searched for attributes.
|
Writer |
getWriter() |
Object |
removeAttribute(String name,
int scope) |
void |
setAttribute(String name,
Object value,
int scope) |
void |
setBindings(Bindings bindings,
int scope) |
void |
setErrorWriter(Writer writer) |
void |
setReader(Reader reader) |
void |
setWriter(Writer writer) |
public void addScope(int scope)
scope
- the scope.@Nullable public Object getAttribute(String name) throws NullPointerException, IllegalArgumentException
getAttribute
in interface ScriptContext
NullPointerException
IllegalArgumentException
@Nullable public Object getAttribute(String name, int scope) throws NullPointerException, IllegalArgumentException
getAttribute
in interface ScriptContext
NullPointerException
IllegalArgumentException
public int getAttributesScope(String name) throws NullPointerException, IllegalArgumentException
getAttributesScope
in interface ScriptContext
NullPointerException
IllegalArgumentException
public Bindings getBindings(int scope) throws IllegalArgumentException
getBindings
in interface ScriptContext
IllegalArgumentException
public Writer getErrorWriter()
getErrorWriter
in interface ScriptContext
public Reader getReader()
getReader
in interface ScriptContext
public List<Integer> getScopes()
getScopes
in interface ScriptContext
public Writer getWriter()
getWriter
in interface ScriptContext
@Nullable public Object removeAttribute(String name, int scope) throws NullPointerException, IllegalArgumentException
removeAttribute
in interface ScriptContext
NullPointerException
IllegalArgumentException
public void setAttribute(String name, Object value, int scope) throws NullPointerException, IllegalArgumentException
setAttribute
in interface ScriptContext
NullPointerException
IllegalArgumentException
public void setBindings(Bindings bindings, int scope) throws NullPointerException, IllegalArgumentException
setBindings
in interface ScriptContext
NullPointerException
IllegalArgumentException
public void setErrorWriter(Writer writer)
setErrorWriter
in interface ScriptContext
public void setReader(Reader reader)
setReader
in interface ScriptContext
public void setWriter(Writer writer)
setWriter
in interface ScriptContext