Home » freemarker-2.3.13 » freemarker.template.utility » [javadoc | source]
freemarker.template.utility
public class: ObjectConstructor [javadoc | source]
java.lang.Object
   freemarker.template.utility.ObjectConstructor

All Implemented Interfaces:
    TemplateMethodModelEx

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)>
Method from freemarker.template.utility.ObjectConstructor Summary:
exec
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from freemarker.template.utility.ObjectConstructor Detail:
 public Object exec(List args) throws TemplateModelException