if (result instanceof Template) {
((Template) result).render(out);
} else {
Formatter<Object> format = (Formatter<Object>) Context.getContext().get(formatterVariable, formatter);
String text = format == null ? StringUtils.toString(result) : format.toString(null, result);
Filter filter = (Filter) Context.getContext().get(filterVariable, valueFilter);
if (! node.isNoFilter() && filter != null) {
text = filter.filter(node.getExpression().toString(), text);
}
try {
if (text != null) {
if (out instanceof Writer) {
((Writer) out).write(text);