public class DefaultTemplateProcessor extends Object implements TemplateProcessor
| Modifier and Type | Field and Description |
|---|---|
static String |
ATTRIBUTE_CUR |
static String |
ATTRIBUTE_IF |
static String |
ATTRIBUTE_INDEX |
static String |
ATTRIBUTE_REPEAT |
static String |
ATTRIBUTE_VAR |
static String |
PROPERTY_COUNT |
static String |
PROPERTY_INDEX |
| Constructor and Description |
|---|
DefaultTemplateProcessor(Expressions expressions) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
evaluate(String expression,
Class<T> type,
T defaultValue)
Evaluates an expression within the scope of this processor's context.
|
TemplateContext |
getTemplateContext() |
void |
processChildNodes(Node result,
Node source)
Process the children of an element or document.
|
void |
processRepeat(Node result,
Element element,
Iterable<?> dataList,
Runnable onEachLoop) |
DocumentFragment |
processTemplate(Element template,
TemplateContext templateContext,
javax.el.ELResolver globals,
TagRegistry registry)
Process an entire template.
|
public static final String PROPERTY_INDEX
public static final String PROPERTY_COUNT
public static final String ATTRIBUTE_IF
public static final String ATTRIBUTE_INDEX
public static final String ATTRIBUTE_REPEAT
public static final String ATTRIBUTE_VAR
public static final String ATTRIBUTE_CUR
@Inject public DefaultTemplateProcessor(Expressions expressions)
public DocumentFragment processTemplate(Element template, TemplateContext templateContext, javax.el.ELResolver globals, TagRegistry registry)
processTemplate in interface TemplateProcessortemplate - the DOM template, typically a script elementtemplateContext - a template context providing top-level
variablesglobals - ELResolver providing global variables other
than those in the templateContextpublic void processChildNodes(Node result, Node source)
processChildNodes in interface TemplateProcessorresult - the node to which results should be appendedsource - the node whose children should be processedpublic TemplateContext getTemplateContext()
getTemplateContext in interface TemplateProcessorpublic void processRepeat(Node result, Element element, Iterable<?> dataList, Runnable onEachLoop)
processRepeat in interface TemplateProcessorresult - element - dataList - public <T> T evaluate(String expression, Class<T> type, T defaultValue)
evaluate in interface TemplateProcessorexpression - The String expressiontype - Expected result typedefaultValue - Default value to return in case of errorCopyright © 2007-2012. All Rights Reserved.