Groovy 1.1 beta 3: method missing
Published by peter September 21st, 2007 in groovy.Groovy 1.1. beta 3 was announced a couple of days ago and includes some interesting additions to the groovy language, like a real method missing. Grails' lead developer Graeme Rocher has a simple example of the way it works in his blog:
GROOVY:
-
"$name : ${varArgs.inspect()}"
-
}
-
delegate."$name"(args)
-
}
-
-
f.sayHello('Fred')
Much better (IMHO) then previous way to do this, which involved intercepting ALL calls to the object on which one would like to catch method missing calls.




















0 Responses to “Groovy 1.1 beta 3: method missing”
Please Wait
Leave a Reply