Class DefaultIterableAdapter

java.lang.Object
freemarker.template.WrappingTemplateModel
freemarker.template.DefaultIterableAdapter
All Implemented Interfaces:
WrapperTemplateModel, AdapterTemplateModel, TemplateCollectionModel, TemplateModel, TemplateModelWithAPISupport, Serializable

Adapts an Iterable to the corresponding TemplateModel interface(s), most importantly to TemplateCollectionModel. This should only be used if Collection is not implemented by the adapted object, because then DefaultListAdapter and DefaultNonListCollectionAdapter gives more functionality.

Thread safety: A DefaultIterableAdapter is as thread-safe as the Iterable that it wraps is. Normally you only have to consider read-only access, as the FreeMarker template language doesn't provide means to call Iterator modifier methods (though of course, Java methods called from the template can violate this rule).

This adapter is used by DefaultObjectWrapper if its iterableSupport property is true, which is not the default for backward compatibility (so you have to set it explicitly).

Since:
2.3.25
See Also:
Serialized Form