public class GroovyInterpreter extends GenericInterpreter
UNDEFINED
Constructor and Description |
---|
GroovyInterpreter() |
Modifier and Type | Method and Description |
---|---|
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.
|
afterExec, afterInterpret, beforeExec, beforeInterpret, contains, containsVariable, containsVariable, get, getClass, getCurrent, getFromNamespace, getFromNamespace, getFunction, getImplicit, getLanguage, getOwner, getVariable, getVariable, interpret, set, setVariable, setVariable, unset, unsetVariable, unsetVariable
public java.lang.Object getNativeInterpreter()
GroovyShell
protected void exec(java.lang.String script)
GenericInterpreter
GenericInterpreter.interpret(java.lang.String, org.zkoss.zk.ui.ext.Scope)
.exec
in class GenericInterpreter
protected boolean contains(java.lang.String name)
GenericInterpreter
By default, it tests whether GenericInterpreter.get(String)
returns non-null.
contains
in class GenericInterpreter
protected java.lang.Object get(java.lang.String name)
GenericInterpreter
GenericInterpreter.beforeExec()
is called first, before this method is invoked.
An empty (and fake) scope 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)
GenericInterpreter
GenericInterpreter.beforeExec()
is called first, before this method is invoked.
set
in class GenericInterpreter
protected void unset(java.lang.String name)
GenericInterpreter
GenericInterpreter.beforeExec()
is called first, before this method is invoked.
unset
in class GenericInterpreter
public void init(Page owner, java.lang.String zslang)
Interpreter
init
in interface Interpreter
init
in class GenericInterpreter
zslang
- the language this interpreter is associated withpublic void destroy()
GenericInterpreter
GenericInterpreter.getOwner()
) to null.destroy
in interface Interpreter
destroy
in class GenericInterpreter
public Function getFunction(java.lang.String name, java.lang.Class[] argTypes)
Currently it only looks for closures, and argTypes are ignored.
getFunction
in interface Interpreter
getFunction
in class GenericInterpreter
argTypes
- the list of argument (a.k.a., parameter) types.
If null, Class[0] is assumed.Copyright © 2005-2018 Potix Corporation. All Rights Reserved.