Class ObjectConstructor

  • All Implemented Interfaces:
    TemplateMethodModel, TemplateMethodModelEx, TemplateModel

    public class ObjectConstructor
    extends java.lang.Object
    implements 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 Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object exec​(java.util.List args)
      Executes the method call.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ObjectConstructor

        public ObjectConstructor()