liqp.nodes.OutputNode Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of liqp Show documentation
Show all versions of liqp Show documentation
A Java implementation of the Liquid templating engine backed up by an ANTLR grammar.
package liqp.nodes;
import liqp.TemplateContext;
import java.util.ArrayList;
import java.util.List;
class OutputNode implements LNode {
private LNode expression;
private List filters;
public OutputNode(LNode expression) {
this.expression = expression;
this.filters = new ArrayList();
}
public void addFilter(FilterNode filter) {
filters.add(filter);
}
@Override
public Object render(TemplateContext context) {
Object value = expression.render(context);
for (FilterNode node : filters) {
value = node.apply(value, context);
}
return value;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy