Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with solutions

 
Nikhil Sun
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,

I am developing an utility for my team.I am working with a file.
Based on this file I generate a class at runtime.This class is a bean type of thing with getters & setters.This class is generated in a folder on my system.Now I have to display as many fields on the browser as there are getters in the class.For this I used reflection and successfully displayed that many fields on the browser.When the user inputs data I again used reflection to call the setters to set the data.So far so good.Now I am required to send this bean instance with the set values as an argument to another method in another program.I can't modify this method or program as it is a standard one already available.But as I was using reflection what I have with me now is the instance of the bean class and not the actual bean instance.Is there a way in which I can get the actual bean instance along with my set values?
 
Jeremy Botha
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Should do the trick.

J
 
Nikhil Sun
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jeremy...that should definitely do the trick.Too silly of me that I didn't reflect on the constructor/s available for the class instance!!!thanks a lot for waking me up:-)
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic