The interface whose implementing classes are used to connect Script Engines with objects, such as scoped Bindings, in hosting applications. Each scope is a set of named attributes whose values can be set and retrieved using the ScriptContext methods. ScriptContexts also expose Readers and Writers that can be used by the ScriptEngines for input and output.
The interface whose implementing classes are used to connect Script Engines with objects, such as scoped Bindings, in hosting applications. Each scope is a set of named attributes whose values can be set and retrieved using the ScriptContext methods. ScriptContexts also expose Readers and Writers that can be used by the ScriptEngines for input and output.
(get-attribute this name)
(get-attribute this name scope)
Gets the value of an attribute in a given scope.
name - The name of the attribute to retrieve. - java.lang.String
scope - The scope in which to retrieve the attribute. - int
returns: The value of the attribute. Returns null is the name
does not exist in the given scope. - java.lang.Object
throws: java.lang.IllegalArgumentException - if the name is empty or if the value of scope is invalid.
Gets the value of an attribute in a given scope. name - The name of the attribute to retrieve. - `java.lang.String` scope - The scope in which to retrieve the attribute. - `int` returns: The value of the attribute. Returns null is the name does not exist in the given scope. - `java.lang.Object` throws: java.lang.IllegalArgumentException - if the name is empty or if the value of scope is invalid.
(get-attributes-scope this name)
Get the lowest scope in which an attribute is defined.
name - Name of the attribute . - java.lang.String
returns: The lowest scope. Returns -1 if no attribute with the given
name is defined in any scope. - int
throws: java.lang.NullPointerException - if name is null.
Get the lowest scope in which an attribute is defined. name - Name of the attribute . - `java.lang.String` returns: The lowest scope. Returns -1 if no attribute with the given name is defined in any scope. - `int` throws: java.lang.NullPointerException - if name is null.
(get-bindings this scope)
Gets the Bindings associated with the given scope in this ScriptContext.
scope - The scope - int
returns: The associated Bindings. Returns null if it has not
been set. - javax.script.Bindings
throws: java.lang.IllegalArgumentException - If no Bindings is defined for the specified scope value in ScriptContext of this type.
Gets the Bindings associated with the given scope in this ScriptContext. scope - The scope - `int` returns: The associated Bindings. Returns null if it has not been set. - `javax.script.Bindings` throws: java.lang.IllegalArgumentException - If no Bindings is defined for the specified scope value in ScriptContext of this type.
(get-error-writer this)
Returns the Writer used to display error output.
returns: The Writer - java.io.Writer
Returns the Writer used to display error output. returns: The Writer - `java.io.Writer`
(get-reader this)
Returns a Reader to be used by the script to read input.
returns: The Reader. - java.io.Reader
Returns a Reader to be used by the script to read input. returns: The Reader. - `java.io.Reader`
(get-scopes this)
Returns immutable List of all the valid values for scope in the ScriptContext.
returns: list of scope values - java.util.List<java.lang.Integer>
Returns immutable List of all the valid values for scope in the ScriptContext. returns: list of scope values - `java.util.List<java.lang.Integer>`
(get-writer this)
Returns the Writer for scripts to use when displaying output.
returns: The Writer. - java.io.Writer
Returns the Writer for scripts to use when displaying output. returns: The Writer. - `java.io.Writer`
(remove-attribute this name scope)
Remove an attribute in a given scope.
name - The name of the attribute to remove - java.lang.String
scope - The scope in which to remove the attribute - int
returns: The removed value. - java.lang.Object
throws: java.lang.IllegalArgumentException - if the name is empty or if the scope is invalid.
Remove an attribute in a given scope. name - The name of the attribute to remove - `java.lang.String` scope - The scope in which to remove the attribute - `int` returns: The removed value. - `java.lang.Object` throws: java.lang.IllegalArgumentException - if the name is empty or if the scope is invalid.
(set-attribute this name value scope)
Sets the value of an attribute in a given scope.
name - The name of the attribute to set - java.lang.String
value - The value of the attribute - java.lang.Object
scope - The scope in which to set the attribute - int
throws: java.lang.IllegalArgumentException - if the name is empty or if the scope is invalid.
Sets the value of an attribute in a given scope. name - The name of the attribute to set - `java.lang.String` value - The value of the attribute - `java.lang.Object` scope - The scope in which to set the attribute - `int` throws: java.lang.IllegalArgumentException - if the name is empty or if the scope is invalid.
(set-bindings this bindings scope)
Associates a Bindings instance with a particular scope in this ScriptContext. Calls to the getAttribute and setAttribute methods must map to the get and put methods of the Bindings for the specified scope.
bindings - The Bindings to associate with the given scope - javax.script.Bindings
scope - The scope - int
throws: java.lang.IllegalArgumentException - If no Bindings is defined for the specified scope value in ScriptContexts of this type.
Associates a Bindings instance with a particular scope in this ScriptContext. Calls to the getAttribute and setAttribute methods must map to the get and put methods of the Bindings for the specified scope. bindings - The Bindings to associate with the given scope - `javax.script.Bindings` scope - The scope - `int` throws: java.lang.IllegalArgumentException - If no Bindings is defined for the specified scope value in ScriptContexts of this type.
(set-error-writer this writer)
Sets the Writer used to display error output.
writer - The Writer. - java.io.Writer
Sets the Writer used to display error output. writer - The Writer. - `java.io.Writer`
(set-reader this reader)
Sets the Reader for scripts to read input .
reader - The new Reader. - java.io.Reader
Sets the Reader for scripts to read input . reader - The new Reader. - `java.io.Reader`
(set-writer this writer)
Sets the Writer for scripts to use when displaying output.
writer - The new Writer. - java.io.Writer
Sets the Writer for scripts to use when displaying output. writer - The new Writer. - `java.io.Writer`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close