- Posted by: Lin jo
- Posted on: May 25 2004 19:06 EDT
I am trying to find out a way to create Java Bean instances at runtime, using a generic tool rather than calling 'getter/setter' methods and setting the values, may be by providing the input parameter as a hash map. I can ofcourse write create a framework, but is there any open source tool out there which I can use directly?
Thanks in advance,
- Generating Java Bean at runtime from hash map values by Paul Strack on May 25 2004 20:12 EDT
Take a look at CGLib [http://cglib.sourceforge.net/]. I believe the net.sf.cglib.beans.BeanGenerator will do what you want.
Here is a weblog with some hints: http://www.sixlegs.com/blog/index.html%3Fyear=2003&month=12.html