|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfreemarker.template.utility.DeepUnwrap
public class DeepUnwrap
Utility methods for unwrapping TemplateModel-s.
| Constructor Summary | |
|---|---|
DeepUnwrap()
|
|
| Method Summary | |
|---|---|
static java.lang.Object |
premissiveUnwrap(TemplateModel model)
Same as unwrap(TemplateModel), but it doesn't throw exception if
it doesn't know how to unwrap
the object, but returns it as is. |
static java.lang.Object |
unwrap(TemplateModel model)
Unwraps TemplateModel-s recursively. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DeepUnwrap()
| Method Detail |
|---|
public static java.lang.Object unwrap(TemplateModel model)
throws TemplateModelException
TemplateModel-s recursively.
The converting of the TemplateModel object happens with the following rules:
AdapterTemplateModel, then the result
of AdapterTemplateModel.getAdaptedObject(Class) for Object.class is returned.
WrapperTemplateModel, then the result
of WrapperTemplateModel.getWrappedObject() is returned.
TemplateScalarModel, then the result
of TemplateScalarModel.getAsString() is returned.
TemplateNumberModel, then the result
of TemplateNumberModel.getAsNumber() is returned.
TemplateDateModel, then the result
of TemplateDateModel.getAsDate() is returned.
TemplateBooleanModel, then the result
of TemplateBooleanModel.getAsBoolean() is returned.
TemplateSequenceModel or
TemplateCollectionModel, then a java.util.ArrayList is
constructed from the subvariables, and each subvariable is unwrapped with
the rules described here (recursive unwrapping).
TemplateHashModelEx, then a
java.util.HashMap is constructed from the subvariables, and each
subvariable is unwrapped with the rules described here (recursive unwrapping).
TemplateModelException, because it doesn't know how to
unwrapp the object.
TemplateModelException
public static java.lang.Object premissiveUnwrap(TemplateModel model)
throws TemplateModelException
unwrap(TemplateModel), but it doesn't throw exception if
it doesn't know how to unwrap
the object, but returns it as is.
TemplateModelException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||