Package freemarker.template
Class SimpleScalar
java.lang.Object
freemarker.template.SimpleScalar
- All Implemented Interfaces:
TemplateModel,TemplateScalarModel,Serializable
A simple implementation of the TemplateScalarModel
interface, using a String.
As of version 2.0 this object is immutable.
This class is thread-safe.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface freemarker.template.TemplateModel
TemplateModel.InvalidExpressionModel, TemplateModel.JavaNull -
Field Summary
Fields inherited from interface freemarker.template.TemplateModel
INVALID_EXPRESSION, JAVA_NULL, NOTHINGFields inherited from interface freemarker.template.TemplateScalarModel
EMPTY_STRING -
Constructor Summary
ConstructorsConstructorDescriptionSimpleScalar(String value) Constructs a SimpleScalar containing a string value. -
Method Summary
-
Constructor Details
-
SimpleScalar
Constructs a SimpleScalar containing a string value.- Parameters:
value- the string value.
-
-
Method Details
-
getAsString
Description copied from interface:TemplateScalarModelReturns 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.- Specified by:
getAsStringin interfaceTemplateScalarModel
-
toString
-