Java Mailing List Archive

http://www.gg3721.com/

Home » user.groovy »

[groovy-user] Is it possible to access properties of Expando
without parentheses?

Setya

2008-08-29

Replies: Find Java Web Hosting

Author LoginPost Reply

Hi all,

Suppose I have the following dynamic object created via Expando :

def myObject = new Expando();
myObject.getMyProperty = {-> print 'Hello World.';}

If I accessed the property with 'myObject.myProperty' it didn't print
anything, but it didn't throw error either.

But If I change into :

myObject.myProperty = {-> print 'Hello World.';}

and accessed using 'myObject.myProperty()', it works as expected.

Any help would be greatly appreciated.

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


©2008 gg3721.com - Jax Systems, LLC, U.S.A.