Author Login
Post Reply
Doesn't your example work for you when Bar is class? What kind of error do
you get?
simonz wrote:
>
>
> ---- Java:
>
> class Bar {
> public void bar() {
> ...
> }
> }
>
> class Foo {
> public Bar bar;
> public void foo() {
> bar.bar();
> }
> }
>
> ---- Groovy:
>
> def called = false;
> def bar = [ bar: { called = true; }] as Bar // Nice!
> new Foo(bar: bar).foo();
> assert called;
>
>
--
Sent from the groovy - user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email