I have an object of type ClassA , and I want to map it on a HashMap , Keys of the HashMap will be the attributes name of classA .
Thank you in advance.
Joybrata Chakraborty
Greenhorn
Joined: Nov 27, 2006
Posts: 29
posted
0
Samy Ganou wrote:I have an object of type ClassA , and I want to map it on a HashMap , Keys of the HashMap will be the attributes name of classA .
Thank you in advance.
Samy Ganou wrote:Thank you , it's the best solution!
Why is it the "best solution"? There's a library that someone else has already built and tested (Dozer), trying to make your own will take you much more time than just using the library.
By the way, I've also once (long ago) written a similar kind of class to view a Java bean as a Map, I have it on my computer somewhere and I've used it in projects on several occasions.