jg.writeStartObject();
final JsonCapturer captured = new JsonCapturer(jg);
MustacheFactory c = new DefaultMustacheFactory(root) {
@Override
public MustacheVisitor createMustacheVisitor() {
return new CapturingMustacheVisitor(this, captured);
}
};
Mustache m = c.compile("complex.html");
StringWriter sw = new StringWriter();
m.execute(sw, new ComplexObject());