TemplateScalarModel (FreeMarker 2.3.23 API)
Date: 2015-07-05

freemarker.template

## Interface TemplateScalarModel

- All Superinterfaces:
    TemplateModel
  All Known Implementing Classes:
    CollectionModel, 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.)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static TemplateModel` | `EMPTY_STRING` A constant value to use as the empty string.

    - ### Fields inherited from interface freemarker.template.TemplateModel

      `NOTHING`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getAsString()` 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. Don't return `null`, as that will cause exception. (In classic-compatible mode the engine will convert `null` into empty string, though.)
      Throws:
        `TemplateModelException`