Home » freemarker-2.3.13 » freemarker.ext.jython » [javadoc | source]
public class: JythonWrapper [javadoc | source]

All Implemented Interfaces:

An object wrapper that wraps Jython objects into FreeMarker template models and vice versa.
Field Summary
public static final  JythonWrapper INSTANCE     
 public JythonWrapper() 
Method from freemarker.ext.jython.JythonWrapper Summary:
isAttributesShadowItems,   setAttributesShadowItems,   setUseCache,   unwrap,   wrap
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from freemarker.ext.jython.JythonWrapper Detail:
 boolean isAttributesShadowItems() 
 public synchronized  void setAttributesShadowItems(boolean attributesShadowItems) 
    Sets whether attributes shadow items in wrapped objects. When true (this is the default value), ${object.name} will first try to locate a python attribute with the specified name on the object using PyObject#__findattr__(java.lang.String) , and only if it doesn't find the attribute will it call PyObject#__getitem__(org.python.core.PyObject) . When set to false, the lookup order is reversed and items are looked up before attributes.
 public  void setUseCache(boolean useCache) 
    Sets whether this wrapper caches model instances. Default is false. When set to true, calling #wrap(Object) multiple times for the same object will return the same model.
 public PyObject unwrap(TemplateModel model) throws TemplateModelException 
    Coerces a template model into a PyObject .
 public TemplateModel wrap(Object obj)