freemarker.ext.jython
Class JythonHashModel
- AdapterTemplateModel, TemplateBooleanModel, TemplateHashModel, TemplateHashModelEx, TemplateMethodModel, TemplateMethodModelEx, TemplateModel, TemplateScalarModel, WrapperTemplateModel
public class JythonHashModel
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.
$Id: JythonHashModel.java,v 1.14 2003/11/12 21:53:40 ddekany Exp $
JythonHashModel
public JythonHashModel(PyObject object,
JythonWrapper wrapper)