|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.jexl3.internal.Script
org.apache.commons.jexl3.internal.Closure
public class Closure
A Script closure.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.commons.jexl3.internal.Script |
---|
Script.Callable, Script.Curried |
Field Summary | |
---|---|
protected Scope.Frame |
frame
The frame. |
Fields inherited from class org.apache.commons.jexl3.internal.Script |
---|
jexl, script, source, version |
Constructor Summary | |
---|---|
protected |
Closure(Interpreter theCaller,
ASTJexlLambda lambda)
Creates a closure. |
Method Summary | |
---|---|
Script.Callable |
callable(JexlContext context,
Object... args)
Creates a Callable from this script. |
boolean |
equals(Object obj)
|
Object |
evaluate(JexlContext context)
Evaluates the expression with the variables contained in the supplied JexlContext . |
Object |
execute(JexlContext context)
Executes the script with the variables contained in the supplied JexlContext . |
Object |
execute(JexlContext context,
Object... args)
Executes the script with the variables contained in the supplied JexlContext and a set of arguments corresponding to the
parameters used during parsing. |
String |
getParsedText()
Recreates the source text of this expression from the internal syntactic tree. |
int |
hashCode()
|
void |
setHoisted(int symbol,
Object value)
Sets the hoisted index of a given symbol, ie the target index of a parent hoisted symbol in this closure's frame. |
String |
toString()
|
Methods inherited from class org.apache.commons.jexl3.internal.Script |
---|
callable, checkCacheVersion, createFrame, createInterpreter, curry, getEngine, getLocalVariables, getParameters, getParsedText, getPragmas, getSourceText, getVariables |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final Scope.Frame frame
Constructor Detail |
---|
protected Closure(Interpreter theCaller, ASTJexlLambda lambda)
theCaller
- the calling interpreterlambda
- the lambdaMethod Detail |
---|
public String toString()
toString
in class Script
public String getParsedText()
JexlScript
getParsedText
in interface JexlExpression
getParsedText
in interface JexlScript
getParsedText
in class Script
public int hashCode()
hashCode
in class Script
public boolean equals(Object obj)
equals
in class Script
public void setHoisted(int symbol, Object value)
This is meant to allow a locally defined function to "see" and call itself as a local (hoisted) variable; in other words, this allows recursive call of a function.
symbol
- the symbol index (in the caller of this closure)value
- the value to set in the local framepublic Object evaluate(JexlContext context)
JexlExpression
JexlContext
.
evaluate
in interface JexlExpression
evaluate
in class Script
context
- A JexlContext containing variables.
public Object execute(JexlContext context)
JexlScript
JexlContext
.
execute
in interface JexlScript
execute
in class Script
context
- A JexlContext containing variables.
public Object execute(JexlContext context, Object... args)
JexlScript
JexlContext
and a set of arguments corresponding to the
parameters used during parsing.
execute
in interface JexlScript
execute
in class Script
context
- A JexlContext containing variables.args
- the arguments
public Script.Callable callable(JexlContext context, Object... args)
Script
This allows to submit it to an executor pool and provides support for asynchronous calls.
The interpreter will handle interruption/cancellation gracefully if needed.
callable
in interface JexlScript
callable
in class Script
context
- the contextargs
- the script arguments
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |