aspose file tools*
The moose likes Beginning Java and the fly likes Variable Method names Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Variable Method names" Watch "Variable Method names" New topic
Author

Variable Method names

Yo Bagus
Greenhorn

Joined: Mar 03, 2006
Posts: 1
Does anyone know if there's a way to do something like this:

MyObject = [an object with 'getDescription()' method]
String methodName="getDescription()";
String description= MyObject.methodName;

In java or jstl or with El, whatever.

Thank you!
Mark Vedder
Ranch Hand

Joined: Dec 17, 2003
Posts: 624

Take a look at the Java Reflection API. If I understand your question, you can do what you are looking to do using reflection. Java Reflection in Action does a nice job of covering the API. Chapter 1 is available as a sample chapter download at the publishers website: http://manning.com/forman/. It will allow you to get up an running.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Variable Method names
 
Similar Threads
HF Design Pattern Book - Question on Starbuzz
decorator pattern from HFDP
Calling instance method without instance
Decorator Pattern Not Clear
Eclipse error - Multiple annotations found at this line.