Package freemarker.template
Interface TemplateHashModelEx
-
- All Superinterfaces:
TemplateHashModel,TemplateModel
- All Known Subinterfaces:
TemplateHashModelEx2
- All Known Implementing Classes:
AllHttpScopesHashModel,ArrayModel,BeanModel,BooleanModel,CollectionModel,DateModel,DefaultMapAdapter,EnumerationModel,Environment.Namespace,HttpRequestHashModel,HttpRequestParametersHashModel,IteratorModel,MapModel,NumberModel,ResourceBundleModel,SimpleHash,SimpleMapModel,StringModel
public interface TemplateHashModelEx extends TemplateHashModel
"extended hash" template language data type; extendsTemplateHashModelby 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TemplateCollectionModelkeys()intsize()TemplateCollectionModelvalues()-
Methods inherited from interface freemarker.template.TemplateHashModel
get, isEmpty
-
-
-
-
Method Detail
-
size
int size() throws TemplateModelException
- Returns:
- the number of key/value mappings in the hash.
- Throws:
TemplateModelException
-
keys
TemplateCollectionModel keys() throws TemplateModelException
- 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
TemplateCollectionModel values() throws TemplateModelException
- Returns:
- a collection containing the values in the hash. The elements of the
returned collection can be any kind of
TemplateModel-s. - Throws:
TemplateModelException
-
-