groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From frenchy48 <bam...@in2p3.fr>
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: http://groovy.329449.n5.nabble.com/aliasing-methods-tp5732316p5732339.html
Sent from the Groovy Users mailing list archive at Nabble.com.

Mime
View raw message