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 ScriptContextNullPointerExceptionIllegalArgumentException@Nullable public Object getAttribute(String name, int scope) throws NullPointerException, IllegalArgumentException
getAttribute in interface ScriptContextNullPointerExceptionIllegalArgumentExceptionpublic int getAttributesScope(String name) throws NullPointerException, IllegalArgumentException
getAttributesScope in interface ScriptContextNullPointerExceptionIllegalArgumentExceptionpublic Bindings getBindings(int scope) throws IllegalArgumentException
getBindings in interface ScriptContextIllegalArgumentExceptionpublic Writer getErrorWriter()
getErrorWriter in interface ScriptContextpublic Reader getReader()
getReader in interface ScriptContextpublic List<Integer> getScopes()
getScopes in interface ScriptContextpublic Writer getWriter()
getWriter in interface ScriptContext@Nullable public Object removeAttribute(String name, int scope) throws NullPointerException, IllegalArgumentException
removeAttribute in interface ScriptContextNullPointerExceptionIllegalArgumentExceptionpublic void setAttribute(String name, Object value, int scope) throws NullPointerException, IllegalArgumentException
setAttribute in interface ScriptContextNullPointerExceptionIllegalArgumentExceptionpublic void setBindings(Bindings bindings, int scope) throws NullPointerException, IllegalArgumentException
setBindings in interface ScriptContextNullPointerExceptionIllegalArgumentExceptionpublic void setErrorWriter(Writer writer)
setErrorWriter in interface ScriptContextpublic void setReader(Reader reader)
setReader in interface ScriptContextpublic void setWriter(Writer writer)
setWriter in interface ScriptContext