public interface TemplateScalarModel extends TemplateModel
TemplateStringModel
. The misnomer is inherited from the
old times, when this was the only single-value type in FreeMarker.)
When a template has to print a value of this class, it will assume that it stores plain text (not HTML, XML, etc.),
and thus it will be possibly auto-escaped. To avoid that, use the appropriate TemplateMarkupOutputModel
instead.Modifier and Type | Field and Description |
---|---|
static TemplateModel |
EMPTY_STRING
A constant value to use as the empty string.
|
NOTHING
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAsString()
Returns the
String representation of this model. |
static final TemplateModel EMPTY_STRING
java.lang.String getAsString() throws TemplateModelException
String
representation of this model. Returning null
is illegal, and may cause
exception in the calling code. (Except, in classic-compatible mode the engine will convert null
into
empty string.)TemplateModelException