Interface EvaluationContext
-
- All Known Implementing Classes:
EvaluationContext.PlainEvaluationContext,Macro.MacroEvaluationContext
interface EvaluationContextThe context of a template evaluation. This consists of the template variables and the template macros. The template variables start with the values supplied by the evaluation call, and can be changed by#setdirectives and during the execution of#foreachand macro calls. The macros are extracted from the template during parsing and never change thereafter.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classEvaluationContext.PlainEvaluationContext
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.ObjectgetVar(java.lang.String var)java.lang.RunnablesetVar(java.lang.String var, java.lang.Object value)Sets the given variable to the given value.booleanvarIsDefined(java.lang.String var)
-
-
-
Method Detail
-
getVar
java.lang.Object getVar(java.lang.String var)
-
varIsDefined
boolean varIsDefined(java.lang.String var)
-
setVar
java.lang.Runnable setVar(java.lang.String var, java.lang.Object value)Sets the given variable to the given value.- Returns:
- a Runnable that will restore the variable to the value it had before. If the variable
was undefined before this method was executed, the Runnable will make it undefined again.
This allows us to restore the state of
$xafter#foreach ($x in ...).
-
-