java.lang.Object
javax.script.SimpleScriptContext
- All Implemented Interfaces:
ScriptContext
Simple implementation of ScriptContext.
- Since:
- 1.6
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Bindings
This is the engine scope bindings.protected Writer
This is the writer to be used to output errors from scripts.protected Bindings
This is the global scope bindings.protected Reader
This is the reader to be used for input from scripts.protected Writer
This is the writer to be used to output from scripts.Fields declared in interface javax.script.ScriptContext
ENGINE_SCOPE, GLOBAL_SCOPE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAttribute
(String name) Retrieves the value of the attribute with the given name in the scope occurring earliest in the search order.getAttribute
(String name, int scope) Gets the value of an attribute in a given scope.int
getAttributesScope
(String name) Get the lowest scope in which an attribute is defined.getBindings
(int scope) Returns the value of theengineScope
field if specified scope isENGINE_SCOPE
.Returns theWriter
used to display error output.Returns aReader
to be used by the script to read input.Returns immutableList
of all the valid values for scope in the ScriptContext.Returns theWriter
for scripts to use when displaying output.removeAttribute
(String name, int scope) Remove an attribute in a given scope.void
setAttribute
(String name, Object value, int scope) Sets the value of an attribute in a given scope.void
setBindings
(Bindings bindings, int scope) Sets aBindings
of attributes for the given scope.void
setErrorWriter
(Writer writer) Sets theWriter
used to display error output.void