public final class UnifiedJEXL.TemplateContext extends Object implements JexlContext, NamespaceResolver
This context exposes its writer as '$jexl' to the scripts.
public for introspection purpose.
| Modifier | Constructor and Description |
|---|---|
protected |
TemplateContext(JexlContext jcontext,
JexlEngine.Frame jframe,
UnifiedJEXL.Expression[] expressions,
Writer out)
Creates a template context instance.
|
| Modifier and Type | Method and Description |
|---|---|
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(edu.internet2.middleware.grouperClientExt.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.
|
protected 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 writerpublic JexlEngine.Frame getFrame()
public Object get(String name)
get in interface JexlContextname - the variable's namepublic 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 namepublic Object resolveNamespace(String ns)
resolveNamespace in interface NamespaceResolverns - the namepublic 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(edu.internet2.middleware.grouperClientExt.org.apache.commons.jexl2.UnifiedJEXL.CompositeExpression composite)
composite - the composite expressionCopyright © 2020 Internet2. All rights reserved.