@Override
public boolean onNodeChildren(FactoryBuilderSupport builder, Object node, Closure content) {
Xpp3Dom dom = (Xpp3Dom)node;
NodeBuilder nodes = new NodeBuilder() {
@Override
protected void setClosureDelegate(final Closure c, final Object o) {
c.setDelegate(this);
c.setResolveStrategy(Closure.DELEGATE_FIRST);
}
@Override
public void setProperty(final String name, final Object value) {
this.invokeMethod(name, value);
}
};
content.setDelegate(nodes);
content.setResolveStrategy(Closure.DELEGATE_FIRST);
Node root = (Node) nodes.invokeMethod(getName(), content);
for (Node child : (List<Node>) root.children()) {
dom.addChild(nodeToXpp3(child));
}