|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface HierachicalAware
An extra interface implemented by an interpreter (Interpreter)
if it supports the hierachical scopes.
By supporting the hierachical scopes we mean the interpreter
associates one interpreter-dependent scope with each ZK's
Namespace. And, variables, classes and methods defined
in zscript are then stored in an individual scope depending on
the namespace when calling Interpreter.interpret(java.lang.String, org.zkoss.zk.scripting.Namespace).
On the other hand, if the interpreter doesn't support the hierachical scopes, it maintains only one global scope and all variables, classes and functions are defined in the global scope.
Interpreter| Method Summary | |
|---|---|
boolean |
containsVariable(Namespace ns,
java.lang.String name)
Tests whether a variable defined in this interpreter. |
Function |
getFunction(Namespace ns,
java.lang.String name,
java.lang.Class[] argTypes)
Returns the method of the specified name defined in this interpreter's scope identified by the specified namespace, or null if not defined. |
java.lang.Object |
getVariable(Namespace ns,
java.lang.String name)
Returns the value of a variable defined in this interpreter's scope identified by the specified namespace. |
void |
setVariable(Namespace ns,
java.lang.String name,
java.lang.Object value)
Sets the value of a variable to this interpreter's scope identified by the specified namespace. |
void |
unsetVariable(Namespace ns,
java.lang.String name)
Removes the value of a variable defined in the interpreter's scope identified by the specified namespace. |
| Method Detail |
|---|
boolean containsVariable(Namespace ns,
java.lang.String name)
Namespace).
It is similar to Interpreter.containsVariable(java.lang.String), except
it uses the specified namespace as a reference to identify the
correct scope for searching the variable.
ns - the namespace used as a reference to identify the
correct scope for searching the variable.
Note: this method doesn't look for any variable stored in ns.
java.lang.Object getVariable(Namespace ns,
java.lang.String name)
Namespace).
It is similar to Interpreter.getVariable(java.lang.String), except
it uses the specified namespace as a reference to identify the
correct scope for searching the variable.
ns - the namespace used as a reference to identify the
correct scope for searching the variable.
Note: this method doesn't look for any variable stored in ns.
void setVariable(Namespace ns,
java.lang.String name,
java.lang.Object value)
It is similar to Interpreter.setVariable(java.lang.String, java.lang.Object), except
it uses the specified namespace as a reference to identify the
correct scope for storing the variable.
ns - the namespace used as a reference to identify the
correct scope for searching the variable.
Note: this method doesn't look for any variable stored in ns.
void unsetVariable(Namespace ns,
java.lang.String name)
It is similar to Interpreter.unsetVariable(java.lang.String), except
it uses the specified namespace as a reference to identify the
correct scope for removing the variable.
ns - the namespace used as a reference to identify the
correct scope for searching the variable.
Note: this method doesn't look for any variable stored in ns.
Function getFunction(Namespace ns,
java.lang.String name,
java.lang.Class[] argTypes)
It is similar to Interpreter.getFunction(java.lang.String, java.lang.Class[]), except
it uses the specified namespace as a reference to identify the
correct scope for searching the variable.
ns - the namespace used as a reference to identify the
correct scope for searching the method.
Note: this method doesn't look for any variable stored in ns.argTypes - 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 | |||||||||