Package freemarker.template
Interface TemplateHashModelEx
- All Superinterfaces:
TemplateHashModel,TemplateModel
- All Known Subinterfaces:
TemplateHashModelEx2
- All Known Implementing Classes:
AllHttpScopesHashModel,AllHttpScopesHashModel,ArrayModel,BeanModel,BooleanModel,CollectionModel,DateModel,DefaultMapAdapter,EnumerationModel,Environment.Namespace,GenericObjectModel,HttpRequestHashModel,HttpRequestHashModel,HttpRequestParametersHashModel,HttpRequestParametersHashModel,IteratorModel,JythonHashModel,MapModel,NumberModel,ResourceBundleModel,RhinoFunctionModel,RhinoScriptableModel,SimpleHash,SimpleMapModel,StringModel
"extended hash" template language data type; extends
TemplateHashModel by allowing
iterating through its keys and values. Consider implementing the modern variation of this,
TemplateHashModelEx2, which allows the more efficient listing of key-value pairs.
In templates they are used like hashes, but these will also work (among others):
myExtHash?size, myExtHash?keys, myExtHash?values, <#list myMap as k, v>.
- See Also:
DefaultMapAdapter,SimpleHash
-
Field Summary
Fields inherited from interface freemarker.template.TemplateModel
NOTHING -
Method Summary
Methods inherited from interface freemarker.template.TemplateHashModel
get, isEmpty
-
Method Details
-
size
- Returns:
- the number of key/value mappings in the hash.
- Throws:
TemplateModelException
-
keys
- Returns:
- a collection containing the keys in the hash. Every element of
the returned collection must implement the
TemplateScalarModel(as the keys of hashes are always strings). - Throws:
TemplateModelException
-
values
- Returns:
- a collection containing the values in the hash. The elements of the
returned collection can be any kind of
TemplateModel-s. - Throws:
TemplateModelException
-