|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jvoicexml.interpreter.scripting.RhinoScriptingEngine
public final class RhinoScriptingEngine
Container for the handling of variables.
Copyright © 2005-2007 JVoiceXML group - http://jvoicexml.sourceforge.net/
| Constructor Summary | |
|---|---|
RhinoScriptingEngine(VoiceXmlInterpreterContext ctx)
Constructs a new object. |
|
| Method Summary | ||
|---|---|---|
|
createHostObject(String name,
Class<T> template)
Creates a host object in the scripting engine from the given java object. |
|
void |
enterScope(Scope previous,
Scope next)
The application has entered the next scope and the
previous scope is no more the current scope. |
|
Object |
eval(String expr)
Evaluates the given expression. |
|
void |
exitScope(Scope previous,
Scope next)
The application has left the previous scope and the
next scope is valid. |
|
Object |
getVariable(String name)
Gets the variables current value. |
|
boolean |
isVariableDefined(String name)
Checks, if the given variable is defined. |
|
void |
removeVariable(String name)
Removes the given variable from the vault. |
|
void |
setVariable(String name,
Object value)
Sets a existing variable to a new value. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RhinoScriptingEngine(VoiceXmlInterpreterContext ctx)
ctx - The current VoiceXML interpreter context.| Method Detail |
|---|
public Object eval(String expr)
throws SemanticError
eval in interface ScriptingEngineexpr - The expression to evaluate.
SemanticError - Error evaluating the expression.
public void setVariable(String name,
Object value)
setVariable in interface ScriptingEnginename - unique identifiervalue - the new value of the variablepublic Object getVariable(String name)
getVariable in interface ScriptingEnginename - unique identifier
public void removeVariable(String name)
removeVariable in interface ScriptingEnginename - unique identifier.public boolean isVariableDefined(String name)
isVariableDefined in interface ScriptingEnginename - Name of the variable to check.
true if the variable is defined.
public void enterScope(Scope previous,
Scope next)
next scope and the
previous scope is no more the current scope.
enterScope in interface ScopeSubscriberprevious - The old scope.next - The new scope.
public void exitScope(Scope previous,
Scope next)
previous scope and the
next scope is valid.
exitScope in interface ScopeSubscriberprevious - The old scope.next - The new scope.
public <T> T createHostObject(String name,
Class<T> template)
throws SemanticError
createHostObject in interface ScriptingEngineT - Type of the host object.name - Name of the shadow variable.template - Base class of the host object.
SemanticError - Error converting the given object to a host object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||