public class SearchExpressionCondition extends java.lang.Object implements TemplateEntry
TemplateEntry
that executes another template in case a search expression applies
to the given data provider.Modifier and Type | Field and Description |
---|---|
private SearchCompiler.Match |
condition |
private TemplateEntry |
text |
Constructor and Description |
---|
SearchExpressionCondition(SearchCompiler.Match condition,
TemplateEntry text)
Creates a new
SearchExpressionCondition . |
Modifier and Type | Method and Description |
---|---|
void |
appendText(java.lang.StringBuilder result,
TemplateEngineDataProvider dataProvider)
Execute this template by generating text for a given data provider.
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
boolean |
isValid(TemplateEngineDataProvider dataProvider)
Check if this template is applicable to the given data provider.
|
java.lang.String |
toString() |
private final SearchCompiler.Match condition
private final TemplateEntry text
public SearchExpressionCondition(SearchCompiler.Match condition, TemplateEntry text)
SearchExpressionCondition
.condition
- the match condition that is checked before applying the child templatetext
- the child template to execute in case the condition is fulfilledpublic void appendText(java.lang.StringBuilder result, TemplateEngineDataProvider dataProvider)
TemplateEntry
appendText
in interface TemplateEntry
result
- the StringBuilder
to append the text todataProvider
- the data provider from which information should be compiled to a stringpublic boolean isValid(TemplateEngineDataProvider dataProvider)
TemplateEntry
isValid
in interface TemplateEntry
dataProvider
- the data provider to checkpublic java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object