...
Because of the concept of context a class does not have one direct meta class that can be generated without its context. The call site defines the place of the context. How the context itself is defined is a TODO. As an implementation strategy it is possible to for example use ClassValue to store a table with the context being a key. The key would probably have to be available as static information, or as easily computable information. Since the resulting meta class could be stored later in the call site object context changes are to be avoided, since it implies the invalidation of the call sites using that context.
Property Discovery
Currently MetaClass discovers properties based on the Java Beans conventions. It also allows pseudo properties matching a convention on java.beans.EventSetDescriptor. This allows the following trick in SwingBuilder for example
| Code Block |
|---|
button(actionPerformed: { println it }) |
The pseudo property actionPerformed is inferred from the single method exposed by ActionListener, a type of listener that can be registered on a JButton. The code responsible for discovering these properties is buried in MetaClassImpl and is not accessible to the outside. It would be great if this mechanism be made pluggable.
Mailing-list discussions
http://groovy.329449.n5.nabble.com/Groovy-3-td5710334.html
...
