|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Interpreter
Represents an interpter that can interpret the scripting codes.
It is easier to implement by extending
from GenericInterpreter.
| Method Summary | |
|---|---|
boolean |
containsVariable(java.lang.String name)
Tests whether the variable is defined in this interpreter. |
void |
destroy()
Called when the interpreter is about to be destroyed. |
java.lang.Class |
getClass(java.lang.String clsnm)
Returns the class defined in this interpreter, or null if not found. |
java.lang.String |
getLanguage()
Returns the scripting language this interpreter is associated with. |
Method |
getMethod(java.lang.String name,
java.lang.Class[] argTypes)
Returns the method of the specified name defined in this interpreter, or null if not defined. |
Page |
getOwner()
Returns the owner of this interpreter. |
java.lang.Object |
getVariable(java.lang.String name)
Returns the value of a variable defined in this interpreter. |
void |
init(Page owner,
java.lang.String zslang)
Initializes the interpreter. |
void |
interpret(java.lang.String script,
Namespace ns)
Evaluates the script against the specified namespace. |
void |
setVariable(java.lang.String name,
java.lang.Object value)
Sets the value of a variable to this interpreter, as if they are defined in the interpreter. |
void |
unsetVariable(java.lang.String name)
Removes the value of a variable defined in this interpreter. |
| Method Detail |
|---|
void init(Page owner,
java.lang.String zslang)
zslang - the language this interpreter is associated withvoid destroy()
Page getOwner()
java.lang.String getLanguage()
void interpret(java.lang.String script,
Namespace ns)
Implementation Note:
LanguageDefinition.getEachTimeScript(java.lang.String)
if not null.Namespaces.getCurrent(org.zkoss.zk.ui.Page)
to retrieve the current namesace if the ns argument is null.
ns - the namspace. If null, the current namespace is assumed.
The current namespace is Namespaces.getCurrent(org.zkoss.zk.ui.Page), which
is the event target's namespace, if the thread is processing an event.
The event target is Event.getTarget().
Otherwise, the current namespace is the owner page's namespace
(getOwner().java.lang.Class getClass(java.lang.String clsnm)
Method getMethod(java.lang.String name,
java.lang.Class[] argTypes)
argTypes - the list of argument (aka., parameter) types.
If null, Class[0] is assumed.boolean containsVariable(java.lang.String name)
Namespace).
java.lang.Object getVariable(java.lang.String name)
Namespace).
void setVariable(java.lang.String name,
java.lang.Object value)
Note: it is not part of any namespace and it has higher prioerty if its name conflicts with any variable defined in the namespaces.
void unsetVariable(java.lang.String name)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||