public class FreemarkerUtil
extends java.lang.Object
Constructor and Description |
---|
FreemarkerUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
ftlVarToCoreJavaObject(freemarker.template.TemplateModel m)
Converts
TemplateModel -s to java.util.* and
java.lang.* objects. |
public static java.lang.Object ftlVarToCoreJavaObject(freemarker.template.TemplateModel m) throws freemarker.template.TemplateModelException
TemplateModel
-s to java.util.*
and
java.lang.*
objects.
java.util.Map
java.util.List
java.lang.Number
java.util.Date
java.lang.Boolean
java.lang.String
Container types (hash, equence, etc.) will be converted recursively, so the subvariables are also converted, and the subvariables of subvariables are converted, etc.
For multi-type variables a single type will be choosen, which is the first type in the above list.
If the TemplateModel
supports
WrapperTemplateModel
, unwrapping will be used only if
the type of the unwrapped object is proper according to the above list.
TemplateModel
-s.freemarker.template.TemplateModelException