Re: Is it possible to add GroovyObject methods via a category?

2017-12-07 Thread Ruben Laguna
There was a typo in my previous mail missingMethod -> methodMissing. It still doesn not work, a.method1() throws MissingMethodException after adding the methodMissing via category. class MyClass{ } a = new MyClass() @Category(MyClass) class MyCategory { def methodMissing(String name, def a

Re: Is it possible to add GroovyObject methods via a category?

2017-12-07 Thread Ruben Laguna
Well I've also tried with propertyMissing and methodMissing and they don't work either: class MyClass{} a = new MyClass() @Category(MyClass) class MyCategory { def missingMethod(String name, def args) { "missingMethod" } def propertyMissing(String name) { "propertyMissing" } def tes

Re: Is it possible to add GroovyObject methods via a category?

2017-12-07 Thread Jochen Theodorou
Am 07.12.2017 um 10:31 schrieb Ruben Laguna: In the Groovy in Action book, chapter 8.4.5 says "Category method names can well take the form of property accessors (pretending property access), operator methods, and GroovyObject methods. MOP hook methods cannot be added through a category class.

Is it possible to add GroovyObject methods via a category?

2017-12-07 Thread Ruben Laguna
In the Groovy in Action book, chapter 8.4.5 says "Category method names can well take the form of property accessors (pretending property access), operator methods, and GroovyObject methods. MOP hook methods cannot be added through a category class. This is a restriction as of Groovy 2.4. The featu