|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.scripting.util.GenericInterpreter
org.zkoss.zkmax.scripting.rhino.RhinoInterpreter
public class RhinoInterpreter
Rhino-based JavaScript interpreter.
| Field Summary |
|---|
| Fields inherited from class org.zkoss.zk.scripting.util.GenericInterpreter |
|---|
UNDEFINED |
| Constructor Summary | |
|---|---|
RhinoInterpreter()
|
|
| Method Summary | |
|---|---|
protected void |
afterExec()
Called after GenericInterpreter.exec(java.lang.String), GenericInterpreter.get(java.lang.String) and many others. |
protected void |
beforeExec()
Called before GenericInterpreter.exec(java.lang.String), GenericInterpreter.get(java.lang.String) and many others. |
protected boolean |
contains(java.lang.String name)
Tests whether a variable is defined in this interpreter. |
void |
destroy()
Reset the owner ( GenericInterpreter.getOwner()) to null. |
protected void |
exec(java.lang.String script)
Executes the specified script. |
protected java.lang.Object |
get(java.lang.String name)
Gets the variable from the interpreter. |
Function |
getFunction(java.lang.String name,
java.lang.Class[] argTypes)
Returns the method. |
java.lang.Object |
getNativeInterpreter()
Returns the native interpreter, or null if it is not initialized or destroyed. |
void |
init(Page owner,
java.lang.String zslang)
Initializes the interpreter. |
protected void |
set(java.lang.String name,
java.lang.Object value)
Sets the variable to the interpreter. |
protected void |
unset(java.lang.String name)
Removes the variable from the interpreter. |
| Methods inherited from class org.zkoss.zk.scripting.util.GenericInterpreter |
|---|
afterInterpret, beforeInterpret, contains, containsVariable, containsVariable, get, getClass, getCurrent, getFromNamespace, getFromNamespace, getFromNamespace, getFunction, getImplicit, getLanguage, getOwner, getVariable, getVariable, interpret, set, setVariable, setVariable, unset, unsetVariable, unsetVariable |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RhinoInterpreter()
| Method Detail |
|---|
public java.lang.Object getNativeInterpreter()
Scriptable
protected void exec(java.lang.String script)
GenericInterpreterGenericInterpreter.interpret(java.lang.String, org.zkoss.zk.scripting.Namespace).
exec in class GenericInterpreterprotected boolean contains(java.lang.String name)
GenericInterpreterBy default, it tests whether GenericInterpreter.get(String) returns non-null.
contains in class GenericInterpreterprotected java.lang.Object get(java.lang.String name)
GenericInterpreterGenericInterpreter.beforeExec() is called first, before this method is invoked.
An empty (and fake) namespace is pushed so GenericInterpreter.getFromNamespace(java.lang.String)
always returns null.
get in class GenericInterpreter
protected void set(java.lang.String name,
java.lang.Object value)
GenericInterpreterGenericInterpreter.beforeExec() is called first, before this method is invoked.
set in class GenericInterpreterprotected void unset(java.lang.String name)
GenericInterpreterGenericInterpreter.beforeExec() is called first, before this method is invoked.
unset in class GenericInterpreterprotected void beforeExec()
GenericInterpreterGenericInterpreter.exec(java.lang.String), GenericInterpreter.get(java.lang.String) and many others.
Default: does nothing.
beforeExec in class GenericInterpreterprotected void afterExec()
GenericInterpreterGenericInterpreter.exec(java.lang.String), GenericInterpreter.get(java.lang.String) and many others.
Default: does nothing.
afterExec in class GenericInterpreter
public void init(Page owner,
java.lang.String zslang)
Interpreter
init in interface Interpreterinit in class GenericInterpreterzslang - the language this interpreter is associated withpublic void destroy()
GenericInterpreterGenericInterpreter.getOwner()) to null.
destroy in interface Interpreterdestroy in class GenericInterpreter
public Function getFunction(java.lang.String name,
java.lang.Class[] argTypes)
Note: JavaScript identifies a function with the name only.
getFunction in interface InterpretergetFunction in class GenericInterpreterargTypes - the list of argument (aka., parameter) types.
If null, Class[0] is assumed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||