Search in sources :

Example 6 with ObjectWrapper

use of freemarker.template.ObjectWrapper in project freemarker by apache.

the class OverloadedMethods2 method getJavaStringSequenceList.

public List getJavaStringSequenceList() throws TemplateModelException {
    ObjectWrapper ow = Environment.getCurrentEnvironment().getObjectWrapper();
    List listList = new ArrayList();
    {
        List list = new ArrayList();
        list.add("a");
        list.add("b");
        listList.add(ow.wrap(list));
    }
    {
        List list = new ArrayList();
        list.add("c");
        listList.add(ow.wrap(list));
    }
    return listList;
}
Also used : ArrayList(java.util.ArrayList) ObjectWrapper(freemarker.template.ObjectWrapper) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

ObjectWrapper (freemarker.template.ObjectWrapper)6 TemplateModel (freemarker.template.TemplateModel)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 LinkedHashMap (java.util.LinkedHashMap)2 List (java.util.List)2 Map (java.util.Map)2 Environment (freemarker.core.Environment)1 Namespace (freemarker.core.Environment.Namespace)1 WrapperTemplateModel (freemarker.ext.util.WrapperTemplateModel)1 AdapterTemplateModel (freemarker.template.AdapterTemplateModel)1 AttemptExceptionReporter (freemarker.template.AttemptExceptionReporter)1 Configuration (freemarker.template.Configuration)1 DefaultObjectWrapper (freemarker.template.DefaultObjectWrapper)1 DefaultObjectWrapperBuilder (freemarker.template.DefaultObjectWrapperBuilder)1 SimpleHash (freemarker.template.SimpleHash)1 SimpleObjectWrapper (freemarker.template.SimpleObjectWrapper)1 SimpleSequence (freemarker.template.SimpleSequence)1 TemplateException (freemarker.template.TemplateException)1 TemplateModelIterator (freemarker.template.TemplateModelIterator)1