I'ld like to wrap all methods of a class a generic way. So I assume I don't know the methods the class is implementing and AOP is not an alternative.
Groovy metaprogramming allows to redefine methods even with parameters but how to do that when you get a list of parameters from reflection.
someClass.metaClass.methods.each { method ->
someClass.metaClass.'${method.name}' = { /* how to define parameters knowing I get them from method.parameterTypes */
}
}
Thanks in advance for the help.