groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From frenchy48 <>
Subject Re: aliasing methods
Date Thu, 14 Apr 2016 16:35:40 GMT
the solution I implemented: redefining "methodmissing" in the classes
described by the resource
and pointing to a static general method that handles the redefined methods:
clazz.metaClass."methodMissing" = { name, args -> missMethod(delegate, name,
args) }
the static missMethod picks up the translation of the method and invokes the
original method.

now still a question: is using systematically "methodMissing" a significant
performance penalty over adding a new method to the metaClass.

member of Grumpy Old Programmers
View this message in context:
Sent from the Groovy Users mailing list archive at

View raw message