|
-
December 28th, 2009, 10:05 PM
#1
Reflection Question with Map<K,V>
Hello,
I'm doing a little work with Java reflection and I seem to have hit a bit of a snag here. In my class, I have a field:
private Map<com.hs.MyKeyType,com.hs.MyValueType> myMap;
I am able to get the field using the getDeclaredFields() function of the class. I can also use: field.getType() function to get the type of the field as java.util.Map class; however, I can't seem to figure out a way to discover what class the Keys and values are.
Is it possible to know what the keys and values are at runtime?
Thanks for your help!
Evan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|