Hi,

I have a Groovy based DSL in which I want to access variables from declared 
bindings. Here's my DSL implementation:

https://gist.github.com/MichaelRueegg/f3f09aeb5853bdb58ca017eb1d4d7a30

As you can see, when I bind the variable magicValue with def (DSL_OK), I can 
access its value in my DSL, whereas otherwise (DSL_NOT_OK) I get a

java.lang.NullPointerException: Cannot get property 'magicValue' on null object

What am I doing wrong? How can I access the variable magicValue without the def 
helper declaration? I think it has something to do with calling rehydrate on 
the closure where I could pass this instead of null, but this does not seem to 
work with nested object hierarchies (Foo->Bar).

Any help is much appreciated.

Thanks, 
Michael

Reply via email to