Interface TemplateScalarModel

All Superinterfaces:
TemplateModel
All Known Implementing Classes:
CollectionModel, GenericObjectModel, JythonHashModel, JythonModel, JythonNumberModel, JythonSequenceModel, LocalizedString, MapModel, NodeListModel, NodeListModel, ResourceBundleLocalizedString, RhinoFunctionModel, RhinoScriptableModel, SimpleScalar, StringModel

public interface TemplateScalarModel extends TemplateModel
"string" template language data-type; like in Java, an unmodifiable UNICODE character sequence. (The name of this interface should be 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.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    A constant value to use as the empty string.

    Fields inherited from interface freemarker.template.TemplateModel

    NOTHING
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the String representation of this model.
  • Field Details

    • EMPTY_STRING

      static final TemplateModel EMPTY_STRING
      A constant value to use as the empty string.
  • Method Details

    • getAsString

      String getAsString() throws TemplateModelException
      Returns the 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.)
      Throws:
      TemplateModelException