freemarker.template
Interface TemplateObjectModel
- All Superinterfaces:
- TemplateModel
- All Known Implementing Classes:
- FastList, ObjectModelBase, ScalarModel, SimpleHash, SimpleList, SimpleNumberModel, FastHash, SortedHash
- public interface TemplateObjectModel
- extends TemplateModel
Simple interface for extracting the underlying object from a given
template model. Implement this interface when you want to:
- Expose the underlying object to the reflection mechanism in the
freemarker.ext.beans
package; or
- Use the underlying object from a
TemplateMethodModel2
implementation
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,v 1.3 2003/11/16 09:56:43 run2000 Exp $
- Author:
- Nicholas Cull
Method Summary |
java.lang.Object |
getAsObject()
Return the underlying object to the reflection mechanism in the
freemarker.ext.beans package. |
getAsObject
public java.lang.Object getAsObject()
throws TemplateModelException
- Return the underlying object to the reflection mechanism in the
freemarker.ext.beans
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