allow to change resolve strategy on jsonbuilder

This commit is contained in:
kimchy 2010-04-17 19:05:30 +03:00
parent b49a1c441c
commit 9c1f2fdec5
1 changed files with 3 additions and 1 deletions

View File

@ -36,6 +36,8 @@ class JsonBuilder {
static NODE_ELEMENT = "element"
static int rootResolveStrategy = Closure.OWNER_FIRST; // the default
def root
def current
@ -70,7 +72,7 @@ class JsonBuilder {
private buildRoot(Closure c) {
c.delegate = this
c.resolveStrategy = Closure.DELEGATE_FIRST
c.resolveStrategy = rootResolveStrategy;
root = [:]
current = root
def returnValue = c.call()