| Modifier and Type | Field and Description |
|---|---|
| protected Bindings | engineScope
This is the engine scope bindings. |
| protected Writer | errorWriter
This is the writer to be used to output errors from scripts. |
| protected Bindings | globalScope
This is the global scope bindings. |
| protected Reader | reader
This is the reader to be used for input from scripts. |
| private static final List | |
| protected Writer | writer
This is the writer to be used to output from scripts. |
| Access | Constructor and Description |
|---|---|
| public | |
| pack-priv | SimpleScriptContext(Reader
the reader reader, Writer the writer writer, Writer the error writer errorWriter)Package-private constructor to avoid needless creation of reader and writers. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public Object | Returns: The value of the attribute in the lowest scope for which an attribute with the given name is defined. Returns null if no attribute with the name exists in any scope.The name of the attribute to retrieve. name)Implements javax. Retrieves the value of the attribute with the given name in the scope occurring earliest in the search order. |
| public Object | Returns: The value of the attribute. Returnsnull is the name
does not exist in the given scope.The name of the attribute to retrieve. name, int The scope in which to retrieve the attribute. scope)Implements javax. Gets the value of an attribute in a given scope. |
| public int | Returns: The lowest scope. Returns -1 if no attribute with the given name is defined in any scope.Name of the attribute
. name)Implements javax. Get the lowest scope in which an attribute is defined. |
| public Bindings | Returns: The value of either theengineScope or globalScope field.The specified scope scope)Implements javax. Returns the value of the |
| public Writer | getErrorWriter()
Implements javax. Returns the |
| public Reader | getReader()
Implements javax. Returns a |
| public List | getScopes()
Implements javax. Returns immutable |
| public Writer | getWriter()
Implements javax. Returns the |
| public Object | Returns: The removed value.The name of the attribute to remove name, int The scope in which to remove the attribute scope)Implements javax. Remove an attribute in a given scope. |
| public void | setAttribute(String
The name of the attribute to set name, Object The value of the attribute value, int The scope in which to set the attribute scope)Implements javax. Sets the value of an attribute in a given scope. |
| public void | setBindings(Bindings
The bindings, int Bindings of attributes to set.The value of the scope in which the attributes are set. scope)Implements javax. Sets a |
| public void | setErrorWriter(Writer writer)
Implements javax. Sets the |
| public void | setReader(Reader reader)
Implements javax. Sets the |
| public void | setWriter(Writer writer)
Implements javax. Sets the |
| private static InputStreamReader |
| engineScope | back to summary |
|---|---|
| protected Bindings engineScope This is the engine scope bindings.
By default, a
| |
| errorWriter | back to summary |
|---|---|
| protected Writer errorWriter This is the writer to be used to output errors from scripts.
By default, a
| |
| globalScope | back to summary |
|---|---|
| protected Bindings globalScope This is the global scope bindings. By default, a null value (which means no global scope) is used. Accessor methods setBindings, getBindings are used to manage this field. | |
| reader | back to summary |
|---|---|
| protected Reader reader This is the reader to be used for input from scripts.
By default, a
| |
| scopes | back to summary |
|---|---|
| private static final List<Integer> scopes | |
| writer | back to summary |
|---|---|
| protected Writer writer This is the writer to be used to output from scripts.
By default, a
| |
| SimpleScriptContext | back to summary |
|---|---|
| public SimpleScriptContext() Create a | |
| SimpleScriptContext | back to summary |
|---|---|
| pack-priv SimpleScriptContext(Reader reader, Writer writer, Writer errorWriter) Package-private constructor to avoid needless creation of reader and writers. It is the caller's responsibility to initialize the engine scope. | |
| checkName | back to summary |
|---|---|
| private void checkName(String name) | |
| getAttribute | back to summary |
|---|---|
| public Object getAttribute(String name) Implements javax. Retrieves the value of the attribute with the given name in the scope occurring earliest in the search order. The order is determined by the numeric value of the scope parameter (lowest scope values first.)
| |
| getAttribute | back to summary |
|---|---|
| public Object getAttribute(String name, int scope) Implements javax. Gets the value of an attribute in a given scope.
| |
| getAttributesScope | back to summary |
|---|---|
| public int getAttributesScope(String name) Implements javax. Get the lowest scope in which an attribute is defined.
| |
| getBindings | back to summary |
|---|---|
| public Bindings getBindings(int scope) Implements javax. Returns the value of the
| |
| getErrorWriter | back to summary |
|---|---|
| public Writer getErrorWriter() Implements javax. Doc from javax. Returns the | |
| getReader | back to summary |
|---|---|
| public Reader getReader() Implements javax. Doc from javax. Returns a | |
| getScopes | back to summary |
|---|---|
| public List Implements javax. Doc from javax. Returns immutable | |
| getWriter | back to summary |
|---|---|
| public Writer getWriter() Implements javax. Doc from javax. Returns the | |
| removeAttribute | back to summary |
|---|---|
| public Object removeAttribute(String name, int scope) Implements javax. Remove an attribute in a given scope.
| |
| setAttribute | back to summary |
|---|---|
| public void setAttribute(String name, Object value, int scope) Implements javax. Sets the value of an attribute in a given scope. If the scope is
| |
| setBindings | back to summary |
|---|---|
| public void setBindings(Bindings bindings, int scope) Implements javax. Sets a
| |
| setErrorWriter | back to summary |
|---|---|
| public void setErrorWriter(Writer writer) Implements javax. Doc from javax. Sets the | |
| setReader | back to summary |
|---|---|
| public void setReader(Reader reader) Implements javax. Doc from javax. Sets the | |
| setWriter | back to summary |
|---|---|
| public void setWriter(Writer writer) Implements javax. Doc from javax. Sets the | |
| stdinReader | back to summary |
|---|---|
| private static InputStreamReader stdinReader() | |