aspose file tools*
The moose likes Java in General and the fly likes How To: Java Reflection for has-a-relationship? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How To: Java Reflection for has-a-relationship?" Watch "How To: Java Reflection for has-a-relationship?" New topic
Author

How To: Java Reflection for has-a-relationship?

Prathamesh Gaddam
Ranch Hand

Joined: Feb 18, 2008
Posts: 58
Dear Ranchers,

I'm willing to define a map with key as methodName and value as related 'java.lang.reflect.Method'. However the problem is, to get the methods of the class member -[which should/is an user defined class/object].

e.g:


So, how can I solve:

1. Get methods dynamically [java.lang.reflect] of class B [eg: class/es which has specific annotation '@Entity'], within/from class A?
2. Both the classes has same field type & name 'String value'. How to add/get it to/from my map collection?

Note: Using HashMap<String,Method>.

Thank you in advance!
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36508
    
  16
Too difficult a question for beginners. Moving.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How To: Java Reflection for has-a-relationship?
 
Similar Threads
Setting bean value problem
Getter and Setter In Java Bean
Help needed in ModelMBean descriptors
jstl and jsp question - edited and reposted
get Property-Field-Name via Reflection