Package freemarker.template
Interface TemplateHashModelEx2
-
- All Superinterfaces:
TemplateHashModel
,TemplateHashModelEx
,TemplateModel
- All Known Implementing Classes:
AllHttpScopesHashModel
,DefaultMapAdapter
,Environment.Namespace
,SimpleHash
,SimpleMapModel
public interface TemplateHashModelEx2 extends TemplateHashModelEx
Adds key-value pair listing capability toTemplateHashModelEx
. While in many cases that can also be achieved withTemplateHashModelEx.keys()
and thenTemplateHashModel.get(String)
, that has some problems. One is thatTemplateHashModel.get(String)
only accepts string keys, whileTemplateHashModelEx.keys()
can return non-string keys too. The other is that callingTemplateHashModelEx.keys()
and thenTemplateHashModel.get(String)
for each key can be slower than listing the key-value pairs in one go.- Since:
- 2.3.25
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
TemplateHashModelEx2.KeyValuePair
A key-value pair in a hash; used forTemplateHashModelEx2.KeyValuePairIterator
.static interface
TemplateHashModelEx2.KeyValuePairIterator
Iterates over the key-value pairs in a hash.
-
Field Summary
-
Fields inherited from interface freemarker.template.TemplateModel
NOTHING
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TemplateHashModelEx2.KeyValuePairIterator
keyValuePairIterator()
-
Methods inherited from interface freemarker.template.TemplateHashModel
get, isEmpty
-
Methods inherited from interface freemarker.template.TemplateHashModelEx
keys, size, values
-
-
-
-
Method Detail
-
keyValuePairIterator
TemplateHashModelEx2.KeyValuePairIterator keyValuePairIterator() throws TemplateModelException
- Returns:
- The iterator that walks through the key-value pairs in the hash. Not
null
. - Throws:
TemplateModelException
-
-