| java.lang.Object freemarker.ext.beans.BeanModel freemarker.ext.beans.StringModel freemarker.ext.beans.MapModel
MapModel | public class MapModel extends StringModel implements TemplateMethodModelEx(Code) | | A special case of
BeanModel that adds implementation
for
TemplateMethodModelEx on map objects that is a shortcut for the
Map.get() method. Note that if the passed argument itself is a
reflection-wrapper model, then the map lookup will be performed using the
wrapped object as the key. Note that you can call get() using the
map.key syntax inherited from
BeanModel as well,
however in that case the key is always a string.
The class itself does not implement the
freemarker.template.TemplateCollectionModel .
You can, however use map.entrySet(), map.keySet(), or
map.values() to obtain
freemarker.template.TemplateCollectionModel instances for
various aspects of the map.
author: Attila Szegedi version: $Id: MapModel.java,v 1.26.2.3 2006/02/26 18:26:37 revusky Exp $ |
Constructor Summary | |
public | MapModel(Map map, BeansWrapper wrapper) Creates a new model that wraps the specified map object.
Parameters: map - the map object to wrap into a model. Parameters: wrapper - the BeansWrapper associated with this model.Every model has to have an associated BeansWrapper instance. |
MapModel | public MapModel(Map map, BeansWrapper wrapper)(Code) | | Creates a new model that wraps the specified map object.
Parameters: map - the map object to wrap into a model. Parameters: wrapper - the BeansWrapper associated with this model.Every model has to have an associated BeansWrapper instance. Themodel gains many attributes from its wrapper, including the caching behavior, method exposure level, method-over-item shadowing policy etc. |
isEmpty | public boolean isEmpty()(Code) | | |
|
|