org.apache.struts2.views.freemarker
Class StrutsBeanWrapper.FriendlyMapModel

java.lang.Object
  extended by freemarker.ext.beans.BeanModel
      extended by freemarker.ext.beans.StringModel
          extended by freemarker.ext.beans.MapModel
              extended by org.apache.struts2.views.freemarker.StrutsBeanWrapper.FriendlyMapModel
All Implemented Interfaces:
freemarker.ext.util.WrapperTemplateModel, freemarker.template.AdapterTemplateModel, freemarker.template.TemplateHashModel, freemarker.template.TemplateHashModelEx, freemarker.template.TemplateMethodModel, freemarker.template.TemplateMethodModelEx, freemarker.template.TemplateModel, freemarker.template.TemplateScalarModel
Enclosing class:
StrutsBeanWrapper

private static final class StrutsBeanWrapper.FriendlyMapModel
extends freemarker.ext.beans.MapModel
implements freemarker.template.TemplateHashModelEx

Attempting to get the best of both worlds of FM's MapModel and SimpleMapModel, by reimplementing the isEmpty(), keySet() and values() methods. ?keys and ?values built-ins are thus available, just as well as plain Map methods.


Field Summary
(package private) static freemarker.ext.util.ModelFactory FACTORY
           
 
Fields inherited from class freemarker.ext.beans.BeanModel
object, wrapper
 
Fields inherited from interface freemarker.template.TemplateModel
NOTHING
 
Fields inherited from interface freemarker.template.TemplateScalarModel
EMPTY_STRING
 
Constructor Summary
StrutsBeanWrapper.FriendlyMapModel(Map map, freemarker.ext.beans.BeansWrapper wrapper)
           
 
Method Summary
 boolean isEmpty()
           
protected  Set keySet()
           
 freemarker.template.TemplateCollectionModel values()
           
 
Methods inherited from class freemarker.ext.beans.MapModel
exec, invokeGenericGet, size
 
Methods inherited from class freemarker.ext.beans.StringModel
getAsString
 
Methods inherited from class freemarker.ext.beans.BeanModel
get, getAdaptedObject, getWrappedObject, hasPlainGetMethod, keys, toString, unwrap, wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface freemarker.template.TemplateHashModelEx
keys, size
 
Methods inherited from interface freemarker.template.TemplateHashModel
get
 

Field Detail

FACTORY

static final freemarker.ext.util.ModelFactory FACTORY
Constructor Detail

StrutsBeanWrapper.FriendlyMapModel

public StrutsBeanWrapper.FriendlyMapModel(Map map,
                                          freemarker.ext.beans.BeansWrapper wrapper)
Method Detail

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface freemarker.template.TemplateHashModel
Overrides:
isEmpty in class freemarker.ext.beans.MapModel

keySet

protected Set keySet()
Overrides:
keySet in class freemarker.ext.beans.MapModel

values

public freemarker.template.TemplateCollectionModel values()
Specified by:
values in interface freemarker.template.TemplateHashModelEx
Overrides:
values in class freemarker.ext.beans.BeanModel


Copyright © 2000-2009 Apache Software Foundation. All Rights Reserved.