TemplateHashModel (FreeMarker 2.3.35 API)
Description: declaration: package: freemarker.template, interface: TemplateHashModel

Package freemarker.template

# Interface TemplateHashModel

All Superinterfaces:
  `TemplateModel`

All Known Subinterfaces:
  `MethodCallAwareTemplateHashModel`, `TemplateHashModelEx`, `TemplateHashModelEx2`

All Known Implementing Classes:
  `AllHttpScopesHashModel`, `AllHttpScopesHashModel`, `ArrayModel`, `BeanModel`, `BooleanModel`, `CollectionModel`, `DateModel`, `DefaultMapAdapter`, `DOMNodeModel`, `EnumerationModel`, `Environment.Namespace`, `GenericObjectModel`, `HttpRequestHashModel`, `HttpRequestHashModel`, `HttpRequestParametersHashModel`, `HttpRequestParametersHashModel`, `HttpSessionHashModel`, `HttpSessionHashModel`, `IteratorModel`, `JythonHashModel`, `JythonModel`, `JythonNumberModel`, `JythonSequenceModel`, `MapModel`, `NodeListModel`, `NodeListModel`, `NodeModel`, `NumberModel`, `ResourceBundleModel`, `RhinoFunctionModel`, `RhinoScriptableModel`, `ServletContextHashModel`, `ServletContextHashModel`, `SimpleHash`, `SimpleMapModel`, `StringModel`, `TaglibFactory`, `TaglibFactory`

public interface TemplateHashModel extends TemplateModel
"hash" template language data type: an object that contains other objects accessible through string keys (sub-variable names). It, in itself, doesn't support listing the keys or values (`TemplateHashModelEx` does).

In templates they are used like `myHash.myKey` or `myHash[myDynamicKey]`.

- ## Field Summary

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

  `NOTHING`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `TemplateModel`
  `get​(String key)`
  Gets a `TemplateModel` from the hash.
  `boolean`
  `isEmpty()`

- ## Method Details

  - ### get

    TemplateModel get​(String key) throws TemplateModelException
    Gets a `TemplateModel` from the hash.
    Parameters:
      `key` - The name by which the `TemplateModel` is identified in the template.
    Returns:
      The `TemplateModel` referred to by the key, or `null` if not found.
    Throws:
      `TemplateModelException`

  - ### isEmpty

    boolean isEmpty() throws TemplateModelException
    Throws:
      `TemplateModelException`