public class StaticText extends java.lang.Object implements TemplateEntry
TemplateEntry
representing a static string.
When compiling the template result, the given string will simply be inserted at the current position.
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
staticText |
Constructor and Description |
---|
StaticText(java.lang.String staticText)
Create a new
StaticText . |
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 java.lang.String staticText
public StaticText(java.lang.String staticText)
StaticText
.staticText
- the text to insert verbatimpublic 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