|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.jexl2.UnifiedJEXL.TemplateContext
public final class UnifiedJEXL.TemplateContext
The type of context to use during evaluation of templates.
This context exposes its writer as '$jexl' to the scripts.
public for introspection purpose.
| Constructor Summary | |
|---|---|
protected |
UnifiedJEXL.TemplateContext(JexlContext jcontext,
JexlEngine.Frame jframe,
UnifiedJEXL.Expression[] expressions,
Writer out)
Creates a template context instance. |
| Method Summary | |
|---|---|
Object |
get(String name)
Gets the value of a variable. |
JexlEngine.Frame |
getFrame()
Gets this context calling frame. |
boolean |
has(String name)
Checks whether a variable is defined in this context. |
void |
include(UnifiedJEXL.Template template,
Object... args)
Includes a call to another template. |
void |
print(int e)
Prints an expression result. |
protected void |
printComposite(org.apache.commons.jexl2.UnifiedJEXL.CompositeExpression composite)
Prints a composite expression. |
Object |
resolveNamespace(String ns)
Resolves a namespace by its name. |
void |
set(String name,
Object value)
Sets the value of a variable. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected UnifiedJEXL.TemplateContext(JexlContext jcontext,
JexlEngine.Frame jframe,
UnifiedJEXL.Expression[] expressions,
Writer out)
jcontext - the base contextjframe - the calling frameexpressions - the list of expression from the template to evaluateout - the output writer| Method Detail |
|---|
public JexlEngine.Frame getFrame()
public Object get(String name)
get in interface JexlContextname - the variable's name
public void set(String name,
Object value)
set in interface JexlContextname - the variable's namevalue - the variable's valuepublic boolean has(String name)
A variable may be defined with a null value; this method checks whether the value is null or if the variable is undefined.
has in interface JexlContextname - the variable's name
public Object resolveNamespace(String ns)
resolveNamespace in interface NamespaceResolverns - the name
public void include(UnifiedJEXL.Template template,
Object... args)
Evaluates a template using this template initial context and writer.
template - the template to evaluateargs - the argumentspublic void print(int e)
e - the expression numberprotected void printComposite(org.apache.commons.jexl2.UnifiedJEXL.CompositeExpression composite)
composite - the composite expression
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||