freemarker.template
Interface TemplateObjectModel

All Superinterfaces:
TemplateModel
All Known Implementing Classes:
ArrayModel, ArrayWrapper, BeanWrapper, CollectionModel, CollectionWrapper, EnumerationModel, EnumerationWrapper, EnumWrapper, ExtendedHash, ExtendedList, FastBoolean, FastHash, FastList, IndexedPropertyWrapper, IterableWrapper, IteratorModel, IteratorWrapper, ListIteratorWrapper, ListModel, ListWrapper, MapModel, MapWrapper, NodeListModel, NumberModel, NumberWrapper, ObjectModel, ObjectModelBase, PropertiesWrapper, ResourceBundleModel, ResourceBundleWrapper, ScalarModel, SimpleHash, SimpleList, SimpleNumberModel

public interface TemplateObjectModel
extends TemplateModel

Simple interface for extracting the underlying object from a given template model. Implement this interface when you want to:

For some object models, this could be a potential security hazard. In these cases, the getAsObject method should return a delegate object instead of the underlying object. The delegate would pass method calls to the underlying object, possibly performing security checks before forwarding the call.

Version:
$Id: TemplateObjectModel.java 1101 2013-04-01 04:17:32Z run2000 $
Author:
Nicholas Cull

Method Summary
 java.lang.Object getAsObject()
          Return the underlying object to the reflection mechanism in the freemarker.ext.beans2 package.
 
Methods inherited from interface freemarker.template.TemplateModel
isEmpty
 

Method Detail

getAsObject

java.lang.Object getAsObject()
                             throws TemplateModelException
Return the underlying object to the reflection mechanism in the freemarker.ext.beans2 package. Any variables, methods or properties can be called directly via reflection.

Returns:
the underlying object for this template model
Throws:
TemplateModelException - the object could not be returned