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