# JiBX: Binding XML to Java Code

### What is JiBX?

JiBX is a tool for binding XML data to Java objects. It's extremely flexible, allowing you to start from existing Java code and generate an XML schema, start from an XML schema and generate Java code, or bridge your existing code to a schema that represents the same data. It also provides very high performance, outperforming all other Java data binding tools across a wide variety of tests.

How does JiBX manage to provide both flexibility and performance? The key is using binding definition documents to specify how your Java objects are converted to or from XML, combined with bytecode enhancement to embed the conversion code directly into your classes. The bytecode enhancement is done by executing one of the JiBX components (the binding compiler) after your Java classes have been compiled. Once the binding compiler has run and your classes have been enhanced with the JiBX binding code, you can continue the normal steps you take in assembling your application (such as building jar files, etc.).

The second JiBX component is the binding runtime. The enhanced class files generated by the binding compiler use this runtime component both for actually building objects from an XML input document (called unmarshalling, in data binding terms) and for generating an XML output document from objects (called marshalling). The runtime uses a separate XML parser (either one based on the XMLPull open source API, or on the StAX Java standard), but is otherwise self-contained.

Performance was originally part of the inspiration for writing JiBX, and JiBX has consistently delivered performance far ahead of the field. We're not aware of any recent published performance comparisions between data binding frameworks, but you can view some older results from the BindMark tests, along with a similar study focused around Web services performance.. These sets of results are both from late 2005, but our own testing shows that little has changed since then.

If you're using JiBX in your development work, check out the JiBX page on the Ohloh Open Source networking site and consider listing yourself as a user. Ohloh is a great site for tracking the open source software that developers are using, and you get to rate the projects based on your experience or even write a review that can help out other developers considering a project.