What's the Groovy equivalent to Python's dir()? -


in python can see methods , fields object has with:

print dir(my_object) 

what's equivalent of in groovy (assuming has one)?

looks particulary nice in groovy (untested, taken link code credit should go there):

// introspection, know details classes : // list constructors of class string.constructors.each{println it}  // list interfaces implemented class string.interfaces.each{println it}  // list methods offered class string.methods.each{println it}  // list methods names string.methods.name  // fields of object (with values) d = new date() d.properties.each{println it} 

the general term looking introspection.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -