What is the easiest way to convert my java beans into xml?

Davanum Srinivas

Use java.beans.XMLEncoder.

XMLEncoder e = new XMLEncoder(
                    new BufferedOutputStream(
                       new FileOutputStream("Test.xml")));
e.writeObject(new JButton("Hello, world"));
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.