I want to be able to create instances of GroovyObjectSupport (in Java) that wrap simple pojos (of any class) on the fly. I was hoping to find something that examined the class type of a provided pojo and implemented the GroovyObjectSupport constructs in AOP/ByteCode, but I’m open to any good ideas.
Ideally it would look something like this:
GroovyObjectSupport gos = GroovyObjectSupportFactory.generate(myPojo);
Cheers.
Could you get away with wrapping it in a Proxy?
ie: you can do this:
The
Proxyclass extendsGroovyObjectSupport