at.newmedialab.ldpath.template.model.freemarker
Class TemplateWrapperModel<T>
java.lang.Object
at.newmedialab.ldpath.template.model.freemarker.TemplateWrapperModel<T>
- All Implemented Interfaces:
- freemarker.template.AdapterTemplateModel, freemarker.template.TemplateModel
public class TemplateWrapperModel<T>
- extends Object
- implements freemarker.template.AdapterTemplateModel
Add file description here!
Author: Sebastian Schaffert
| Fields inherited from interface freemarker.template.TemplateModel |
NOTHING |
|
Method Summary |
T |
getAdaptedObject(Class hint)
Retrieves the underlying object, or some other object semantically
equivalent to its value narrowed by the class hint. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TemplateWrapperModel
public TemplateWrapperModel(T object)
getAdaptedObject
public T getAdaptedObject(Class hint)
- Retrieves the underlying object, or some other object semantically
equivalent to its value narrowed by the class hint.
- Specified by:
getAdaptedObject in interface freemarker.template.AdapterTemplateModel
- Parameters:
hint - the desired class of the returned value. An implementation
should make reasonable effort to retrieve an object of the requested
class, but if that is impossible, it must at least return the underlying
object as-is. As a minimal requirement, an implementation must always
return the exact underlying object when
hint.isInstance(underlyingObject) == true holds. When called
with java.lang.Object.class, it should return a generic Java
object (i.e. if the model is wrapping a scripting lanugage object that is
further wrapping a Java object, the deepest underlying Java object should
be returned).
- Returns:
- the underlying object, or its value accommodated for the hint
class.
Copyright © 2012 Salzburg Research. All Rights Reserved.