public abstract class TextTemplate extends Object
It keeps all parameters necessary for compilation of the template.
FreeMarkerTemplate| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Object> |
properties
Map with properties that is intended to use for substitution of variables within this template.
|
| Constructor and Description |
|---|
TextTemplate(Map<String,Object> props)
Constructs a new TextTemplate.
|
| Modifier and Type | Method and Description |
|---|---|
abstract String |
compile()
Compiles this template.
|
abstract void |
compileAndWrite(Writer writer)
Compiles this template and writes result using given writer.
|
TextTemplate |
put(Map<String,Object> props)
Puts all properties of given map into properties of this template.
|
TextTemplate |
put(String varName,
Object value)
Puts a new property into properties of this template.
|
public TextTemplate put(Map<String,Object> props)
props - the map with properties to put.public TextTemplate put(String varName, Object value)
varName - the template variable name for which this property defines a value.value - the actual value that should be used instead of variable during compilation of this template.public abstract String compile()
Copyright © 2023. All rights reserved.