Simple implementation of ScriptContext.
Simple implementation of ScriptContext.
(->simple-script-context)
Constructor.
Create a SimpleScriptContext.
Constructor. Create a SimpleScriptContext.
(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)
Returns the value of the engineScope field if specified scope is ENGINE_SCOPE. Returns the value of the globalScope field if the specified scope is GLOBAL_SCOPE.
scope - The specified scope - int
returns: The value of either the engineScope or globalScope field. - javax.script.Bindings
throws: java.lang.IllegalArgumentException - if the value of scope is invalid.
Returns the value of the engineScope field if specified scope is ENGINE_SCOPE. Returns the value of the globalScope field if the specified scope is GLOBAL_SCOPE. scope - The specified scope - `int` returns: The value of either the engineScope or globalScope field. - `javax.script.Bindings` throws: java.lang.IllegalArgumentException - if the value of scope is invalid.
(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)
Sets a Bindings of attributes for the given scope. If the value of scope is ENGINE_SCOPE the given Bindings replaces the engineScope field. If the value of scope is GLOBAL_SCOPE the given Bindings replaces the globalScope field.
bindings - The Bindings of attributes to set. - javax.script.Bindings
scope - The value of the scope in which the attributes are set. - int
throws: java.lang.IllegalArgumentException - if scope is invalid.
Sets a Bindings of attributes for the given scope. If the value of scope is ENGINE_SCOPE the given Bindings replaces the engineScope field. If the value of scope is GLOBAL_SCOPE the given Bindings replaces the globalScope field. bindings - The Bindings of attributes to set. - `javax.script.Bindings` scope - The value of the scope in which the attributes are set. - `int` throws: java.lang.IllegalArgumentException - if scope is invalid.
(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