Going further
In this tutorial, you learned the basics of using JiBX to generate an XML schema definition from your Java code and then convert documents matching that schema to and from Java data structures. There are many other customizations you can use to control the schema generation, beyond those I've covered in this tutorial. The JiBX documentation provides full details on all these customization options, along with more examples of schema generation from code.
You can go even further with JiBX by working with the actual binding definitions, which give you control over every step of the conversion process. You can easily add your own code to be executed as part of the conversions, using user extension hooks built into the binding definitions. You can even create your own custom marshalling and unmarshalling code that can selectively take over control from the code generated by JiBX to handle unique XML or Java data structures. The JiBX documentation includes a tutorial that illustrates many aspects of working with binding definitions, including these extension features, along with reference documentation for all the details.
JiBX is especially convenient when you want to develop a schema definition quickly for data exchange without needing to learn a lot about schema. The XML Schema standard is complex, and tools for working with schema definitions provide little support for restructuring and refactoring schemas. By using Java code and BindGen as the basis for your schema development as shown in this tutorial, you can apply all the flexibility of Java IDEs to create schema definitions quickly and easily without in any way committing yourself to using JiBX.
JiBX also includes a tool for generating complete WSDL and schema definitions for Web
services based on Java code. This tool, named Jibx2Wsdl, builds on top of BindGen. You
can use all the BindGen customizations discussed in this article for the data classes
used as inputs and outputs for your service methods, so that the generated schema will
reflect your preferences. The JiBX documentation provides details on how to use Jibx2Wsdl.
In Part 2, you'll learn how to use JiBX to generate Java code from XML schema definitions.
|