|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfreemarker.template.utility.ObjectConstructor
public class ObjectConstructor
An object that you can make available in a template
to instantiate arbitrary beans-wrapped objects in a template.
Beware of this class's security implications. It allows
the instantiation of arbitrary objects and invoking
methods on them. Usage is something like:
myDataModel.put("objectConstructor", new ObjectConstructor());
And then from your FTL code:
<#assign aList = objectConstructor("java.util.ArrayList", 100)>
Field Summary |
---|
Fields inherited from interface freemarker.template.TemplateModel |
---|
NOTHING |
Constructor Summary | |
---|---|
ObjectConstructor()
|
Method Summary | |
---|---|
java.lang.Object |
exec(java.util.List args)
Executes a method call. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ObjectConstructor()
Method Detail |
---|
public java.lang.Object exec(java.util.List args) throws TemplateModelException
TemplateMethodModelEx
exec
in interface TemplateMethodModel
exec
in interface TemplateMethodModelEx
args
- a List of TemplateModel
objects
containing the values of the arguments passed to the method. If the
implementation wishes to operate on POJOs that might be underlying the
models, it can use the static utility methods in the DeepUnwrap
class to easily obtain them.
TemplateModel
, it will be automatically
wrapped using the environment
object wrapper
.
TemplateModelException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |