It's not a full solution, only example, but I think, you should do it this way:
class Parent{
def container = new ArrayList<>()
def child(element) {
println "add child$element to parent"
container.add(element)
}
def parent(Closure closure){
closure.delegate = this
closure.resolveStrategy = Closure.DELEGATE_FIRST
closure.call()
container
}
}
new Parent().parent {
child(1) // Here we are trying to resolve child method in our delegate, then owner.
child(2)
}
Of course, you can remove new Parent in future, it's only quick example, to show you delegate magic.