|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfreemarker.ext.beans2.Unwrapper
public class Unwrapper
Unwraps a given FM-Classic template model back into a plain old Java object. If a target class is supplied, try to convert the model using the most appropriate conversion available. Otherwise, perform a default conversion into a Java object.
| Method Summary | ||
|---|---|---|
static java.lang.Object |
defaultUnwrap(TemplateModel model)
Convert the supplied template model into a plain old Java object. |
|
static
|
unwrap(TemplateModel model,
java.lang.Class<T> target)
Convert the supplied template model into a plain old Java object of the given class. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static java.lang.Object defaultUnwrap(TemplateModel model)
throws TemplateModelException,
java.lang.ClassCastException,
java.lang.NullPointerException
TemplateObjectModel, unwrap the object
back to the underlying object. Otherwise, perform a default conversion
to the nearest equivalent Java object.
model - the model to be unwrapped
TemplateModelException - there was a problem unwrapping the
template model
java.lang.ClassCastException
java.lang.NullPointerException
public static <T> T unwrap(TemplateModel model,
java.lang.Class<T> target)
throws TemplateModelException,
java.lang.ClassCastException,
java.lang.NullPointerException
model - the template model to be unwrappedtarget - the target class for the unwrapping
TemplateModelException - the model could not be converted to the
target class
java.lang.ClassCastException
java.lang.NullPointerException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||