Search in sources :

Example 1 with CollectionModel

use of pcgen.output.model.CollectionModel in project pcgen by PCGen.

the class TypeActor method process.

/**
	 * @see pcgen.output.base.OutputActor#process(pcgen.cdom.enumeration.CharID,
	 * java.lang.Object)
	 */
@Override
public TemplateModel process(CharID id, CDOMObject d) throws TemplateModelException {
    final List<Type> types = d.getSafeListFor(ListKey.TYPE);
    List<String> strings = new ArrayList<>(types.size());
    for (Type type : types) {
        strings.add(type.toString());
    }
    return new CollectionModel(id, strings);
}
Also used : Type(pcgen.cdom.enumeration.Type) CollectionModel(pcgen.output.model.CollectionModel) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 Type (pcgen.cdom.enumeration.Type)1 CollectionModel (pcgen.output.model.CollectionModel)1