Interface TemplateEntry
- All Known Implementing Classes:
CompoundTemplateEntry,Condition,ContextSwitchTemplate,SearchExpressionCondition,StaticText,Variable
public interface TemplateEntry
Interface for one node in the abstract syntax tree that is the result of parsing a template
string with
TemplateParser.
The node can either be branching (condition, context switch) or a leaf node (variable, static text).
The root node, representing the entire template is also a TemplateEntry.-
Method Summary
Modifier and TypeMethodDescriptionvoidappendText(StringBuilder result, TemplateEngineDataProvider dataProvider) Execute this template by generating text for a given data provider.default StringgetText(TemplateEngineDataProvider dataProvider) Execute this template by generating text for a given data provider.booleanisValid(TemplateEngineDataProvider dataProvider) Check if this template is applicable to the given data provider.
-
Method Details
-
getText
Execute this template by generating text for a given data provider.- Parameters:
dataProvider- the data provider from which information should be compiled to a string- Returns:
- the generated text
-
appendText
Execute this template by generating text for a given data provider.- Parameters:
result- theStringBuilderto append the text todataProvider- the data provider from which information should be compiled to a string
-
isValid
Check if this template is applicable to the given data provider.- Parameters:
dataProvider- the data provider to check- Returns:
- true if all conditions are fulfilled to apply the template (for instance all required key=value mappings are present), false otherwise
-