public final class CompoundTemplateEntry extends java.lang.Object implements TemplateEntry
TemplateEntry
that concatenates several templates.Modifier and Type | Field and Description |
---|---|
private TemplateEntry[] |
entries |
Modifier | Constructor and Description |
---|---|
private |
CompoundTemplateEntry(TemplateEntry... entries) |
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.
|
static TemplateEntry |
fromArray(TemplateEntry... entries)
Factory method to concatenate several
TemplateEntry s. |
boolean |
isValid(TemplateEngineDataProvider dataProvider)
Check if this template is applicable to the given data provider.
|
java.lang.String |
toString() |
private final TemplateEntry[] entries
private CompoundTemplateEntry(TemplateEntry... entries)
public static TemplateEntry fromArray(TemplateEntry... entries)
TemplateEntry
s.
If the number of entries is 0 or 1, the result may not be a CompoundTemplateEntry
,
but optimized to a static text or the single entry itself.entries
- the TemplateEntry
s to concatenateTemplateEntry
that concatenates all the entriespublic 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