use of org.stringtemplate.v4.Interpreter in project bndtools by bndtools.
the class StringTemplateEngine method extractAttrs.
private void extractAttrs(ST st, final Map<String, String> attrs) throws Exception {
Interpreter interpreter = new Interpreter(st.groupThatCreatedThisInstance, Locale.getDefault(), true) {
@Override
public Object getAttribute(InstanceScope scope, String name) {
attrs.put(name, null);
return "X";
}
};
StringWriter writer = new StringWriter();
interpreter.exec(new AutoIndentWriter(writer), new InstanceScope(null, st));
}
Aggregations