|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.script.AbstractScriptEngine
public abstract class AbstractScriptEngine
GenericScriptEngine is an abstarct class which implements the ScriptEngine interface and it contains default implementations for several eval() methods.
Field Summary |
---|
Fields inherited from interface javax.script.ScriptEngine |
---|
ARGV, ENGINE, ENGINE_VERSION, FILENAME, LANGUAGE, LANGUAGE_VERSION, NAME |
Constructor Summary | |
---|---|
AbstractScriptEngine()
Constructs a ScriptEngine using an uninitialized SimpleNamespace. |
|
AbstractScriptEngine(Bindings namespace)
Constructs a ScriptEngine using the specified namespace as its ENGINE_SCOPE. |
Method Summary | |
---|---|
java.lang.Object |
eval(java.io.Reader reader)
Evaluates a piece of script obtained using the specified reader as the script source. |
java.lang.Object |
eval(java.io.Reader reader,
Bindings nameSpace)
Evaluates a piece of scripts obtained using a reader as the script source and using the specified namespace as the SCRIPT_SCOPE. |
java.lang.Object |
eval(java.lang.String script)
Evaluates a piece of script and returns the resultant object. |
java.lang.Object |
eval(java.lang.String script,
Bindings nameSpace)
Evaluates a piece of script using the specified namespace as its SCRIPT_SCOPE. |
java.lang.Object |
get(java.lang.String key)
Retrieves the associated value with the specified key ScriptEngine namespace. |
Bindings |
getBindings(int scope)
Retrieves a reference to the associated namespace for the specified level of scope. |
ScriptContext |
getContext()
Return the script context. |
void |
put(java.lang.String key,
java.lang.Object value)
Associates a key and a value in the ScriptEngine namespace. |
void |
setBindings(Bindings namespace,
int scope)
Associates a namespace with a specified level of scope. |
void |
setContext(ScriptContext ctx)
Set a new context. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.script.ScriptEngine |
---|
createBindings, eval, eval, getFactory |
Constructor Detail |
---|
public AbstractScriptEngine()
public AbstractScriptEngine(Bindings namespace)
namespace
- the namespace to be used as the ENGINE_SCOPEMethod Detail |
---|
public void setContext(ScriptContext ctx)
setContext
in interface ScriptEngine
ctx
- The contextpublic ScriptContext getContext()
getContext
in interface ScriptEngine
public java.lang.Object eval(java.io.Reader reader) throws ScriptException
eval
in interface ScriptEngine
reader
- the reader form which the script is obtained
ScriptException
- if an error occurspublic java.lang.Object eval(java.io.Reader reader, Bindings nameSpace) throws ScriptException
eval
in interface ScriptEngine
reader
- the reader from which the script is obtainednameSpace
- the namespace to be used as SCRIPT_SCOPE
ScriptException
- if an error occurspublic java.lang.Object eval(java.lang.String script) throws ScriptException
eval
in interface ScriptEngine
script
- the String representation of the script
ScriptException
- if an error occurspublic java.lang.Object eval(java.lang.String script, Bindings nameSpace) throws ScriptException
eval
in interface ScriptEngine
script
- the String representation of the scriptnameSpace
- the namespace to be used as the SCRIPT_SCOPE
ScriptException
- if an error occurspublic java.lang.Object get(java.lang.String key)
get
in interface ScriptEngine
key
- the associated key of the value
public Bindings getBindings(int scope)
getBindings
in interface ScriptEngine
scope
- the specified level of scope
java.lang.IllegalArgumentException
- if the scope is invalidpublic void put(java.lang.String key, java.lang.Object value)
put
in interface ScriptEngine
key
- String value which uniquely identifies the valuevalue
- value which is to be associated with the
specified key
java.lang.IllegalArgumentException
- if the key is nullpublic void setBindings(Bindings namespace, int scope) throws java.lang.UnsupportedOperationException
setBindings
in interface ScriptEngine
namespace
- the namespace to be associated with specified scopescope
- the level of scope of the specified namespace
java.lang.UnsupportedOperationException
java.lang.IllegalArgumentException
- if scope is invalid
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |