Using KBML to Serialize and Deserialize Java Beans

The Koala Bean Markup Language (KBML) writes beans to XML using a Java-specific format. Specifically, it writes out beans using a <bean> tag and writes bean properties using a <property> tag. Because KBML uses its own specific XML format, it isn't suitable for most XML data exchange. It makes an excellent serialization tool, however.

You can get the latest version of KBML from http://www-sop.inria.fr/koala/kbml/.

Listing 24.4 shows a program that writes a Person object out to an XML file using KBML.

Code Listing 24.4. Source Code for KoalaWrite.java
 package usingj2ee.xml; import java.io.*; import fr.dyade.koala.xml.kbml.*; public class KoalaWrite { public static void main(String[] args) { try ...

Get Special Edition Using Java™ 2 Enterprise Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.