Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I restore a JavaBean from a saved version?

javabean restore Saved version
0
Posted

How do I restore a JavaBean from a saved version?

0

Location: http://www.jguru.com/faq/view.jsp?EID=13631 Created: Feb 12, 2000 Author: John Zukowski (http://www.jguru.com/guru/viewbio.jsp?EID=7) Instead of continually creating JavaBeans components and setting their state to some common setting, you can save what tends to be called a pickled version of the component, with the bean properties set to their desired value. This would be saved to a .ser file in the JAR file of the application. Then, to create a version of the bean from this prototype, you would use Beans.instantiate(…) to create an instance of the component, as in: Beans.instantiate (null, “mypackage.MyBean”); The first argument is the class loader, where null is used if you wish to use the system class loader, instead of a custom one.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123