Package freemarker.template
Interface TemplateScalarModel
-
- All Superinterfaces:
TemplateModel
- All Known Implementing Classes:
LocalizedString,ResourceBundleLocalizedString,SimpleScalar
public interface TemplateScalarModel extends TemplateModel
String values in a template data model must implement this interface. (Actually, the name of this interface should beTemplateStringModel. The bad name was inherited from the ancient times, when there was only 1 kind of scalars in FreeMarker.)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface freemarker.template.TemplateModel
TemplateModel.InvalidExpressionModel, TemplateModel.JavaNull
-
-
Field Summary
Fields Modifier and Type Field Description static TemplateModelEMPTY_STRINGA constant value to use as the empty string.-
Fields inherited from interface freemarker.template.TemplateModel
INVALID_EXPRESSION, JAVA_NULL, NOTHING
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetAsString()Returns the string representation of this model.
-
-
-
Field Detail
-
EMPTY_STRING
static final TemplateModel EMPTY_STRING
A constant value to use as the empty string.
-
-
Method Detail
-
getAsString
String getAsString() throws TemplateModelException
Returns the string representation of this model. In general, avoid returning null. In compatibility mode the engine will convert null into empty string, however in normal mode it will throw an exception if you return null from this method.- Throws:
TemplateModelException
-
-