Home » freemarker-2.3.13 » freemarker.ext.jython » [javadoc | source]
freemarker.ext.jython
public class: JythonHashModel [javadoc | source]
java.lang.Object
   freemarker.ext.jython.JythonModel
      freemarker.ext.jython.JythonHashModel

All Implemented Interfaces:
    TemplateHashModelEx, AdapterTemplateModel, TemplateBooleanModel, TemplateMethodModelEx, WrapperTemplateModel, TemplateHashModel, TemplateScalarModel

Model for Jython dictionaries (org.python.core.PyDictionary and org.python.core.PyStringMap ). Note that the basic JythonModel already provides access to the PyObject#__finditem__(String) method. This class only adds TemplateHashModelEx functionality in a somewhat skewed way. One could say it even violates TemplateHashModelEx semantics, as both the returned keys and values are only those from the item mapping, while the get() method works for attributes as well. However, in practice when you ask for dict?keys inside a template, you'll really want to retrieve only items, not attributes so this is considered OK.
Field Summary
static final  ModelFactory FACTORY     
Fields inherited from freemarker.ext.jython.JythonModel:
object,  wrapper,  FACTORY
Constructor:
 public JythonHashModel(PyObject object,
    JythonWrapper wrapper) 
Method from freemarker.ext.jython.JythonHashModel Summary:
keys,   size,   values
Methods from freemarker.ext.jython.JythonModel:
exec,   get,   getAdaptedObject,   getAsBoolean,   getAsString,   getWrappedObject,   isEmpty
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from freemarker.ext.jython.JythonHashModel Detail:
 public TemplateCollectionModel keys() throws TemplateModelException 
    Returns either object.__findattr__("keys").__call__() or object.__findattr__("keySet").__call__().
 public int size() throws TemplateModelException 
 public TemplateCollectionModel values() throws TemplateModelException 
    Returns object.__findattr__("values").__call__().