public class FreemarkerTemplateModel extends freemarker.template.WrappingTemplateModel implements freemarker.template.TemplateHashModelEx, freemarker.template.AdapterTemplateModel
Although this class is public, it should not normally be use directly.
Follow the instructions in FreemarkerObjectWrapper
to use this class.
Constructor and Description |
---|
FreemarkerTemplateModel(Bean bean,
FreemarkerObjectWrapper wrapper)
Creates an instance of the model.
|
Modifier and Type | Method and Description |
---|---|
freemarker.template.TemplateModel |
get(String key)
Gets the value for the specified key, wrapping the result in another model.
|
Object |
getAdaptedObject(Class hint)
Unwraps the model, returning the bean.
|
boolean |
isEmpty()
Checks if there are no properties.
|
freemarker.template.TemplateCollectionModel |
keys()
Gets the full set of property names, allowing the bean to be accessed as a sequence.
|
int |
size()
Gets the number of properties.
|
freemarker.template.TemplateCollectionModel |
values()
Gets the full set of property values, allowing the bean to be accessed as a sequence.
|
public FreemarkerTemplateModel(Bean bean, FreemarkerObjectWrapper wrapper)
bean
- the bean being wrapped, not nullwrapper
- the default wrapper for further wrapping, not nullpublic freemarker.template.TemplateModel get(String key) throws freemarker.template.TemplateModelException
get
in interface freemarker.template.TemplateHashModel
key
- the property name, not nullfreemarker.template.TemplateModelException
public boolean isEmpty()
isEmpty
in interface freemarker.template.TemplateHashModel
public int size()
size
in interface freemarker.template.TemplateHashModelEx
public freemarker.template.TemplateCollectionModel keys()
keys
in interface freemarker.template.TemplateHashModelEx
public freemarker.template.TemplateCollectionModel values()
values
in interface freemarker.template.TemplateHashModelEx
public Object getAdaptedObject(Class hint)
getAdaptedObject
in interface freemarker.template.AdapterTemplateModel
hint
- the class hintCopyright © 2007–2013 Joda.org. All rights reserved.