Author Login
Post Reply
Hi blackdrag,
Thanks for quick response.
I've tried your suggestions, but none of them works.
Regarding ExpandoMetaClass.enableGlobally(), If I put it in
MyGroovyClassImpl.groovy than the GroovyClassLoader won't parse the file as
instance of MyJavaInterface. If I add it when evaluating the script, it
doesn't take effect.
But If I put those scripts in 1 file it works as expected as follows:
class MyGroovyClassImpl
{
MyGroovyClassImpl()
{
MyGroovyClassImpl.metaClass.getNext = {->println 'This is next
command.';};
}
}
ExpandoMetaClass.enableGlobally();
def context = new MyGroovyClassImpl();
context.next;
Regards,
Setya
--
Sent from the groovy - user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email