Search in sources :

Example 1 with CollectionAndSequence

use of freemarker.core.CollectionAndSequence in project freemarker by apache.

the class BeanModel method values.

public TemplateCollectionModel values() throws TemplateModelException {
    List<Object> values = new ArrayList<Object>(size());
    TemplateModelIterator it = keys().iterator();
    while (it.hasNext()) {
        String key = ((TemplateScalarModel) it.next()).getAsString();
        values.add(get(key));
    }
    return new CollectionAndSequence(new SimpleSequence(values, wrapper));
}
Also used : TemplateModelIterator(freemarker.template.TemplateModelIterator) CollectionAndSequence(freemarker.core.CollectionAndSequence) ArrayList(java.util.ArrayList) TemplateScalarModel(freemarker.template.TemplateScalarModel) SimpleSequence(freemarker.template.SimpleSequence)

Aggregations

CollectionAndSequence (freemarker.core.CollectionAndSequence)1 SimpleSequence (freemarker.template.SimpleSequence)1 TemplateModelIterator (freemarker.template.TemplateModelIterator)1 TemplateScalarModel (freemarker.template.TemplateScalarModel)1 ArrayList (java.util.ArrayList)1