Unmarshalling and Marshalling

Now that you have a basic understanding of what Quick does, you’re ready to learn how to use it. This section will cover conversion to and from XML using Quick and demonstrate the mapping features that it provides. Because Quick is a bit different from the other data binding frameworks, I recommend that you work through this section in order.

Unmarshalling

The first step in getting things going with Quick is to ensure you have a DTD on hand. That DTD will be the basis for generating some files that Quick needs in order to operate.

Warning

It is possible to use Quick by creating a Quick-specific data schema for modeling constraints directly. However, you can’t validate against this sort of schema, and you can’t exchange it with others who don’t know Quick. For that reason, it is always better to start with a DTD, which is universally understood, and use Quick’s tools to convert that DTD to Quick-specific formats.

Have Java classes on hand

Because the typical Quick processing cycle doesn’t involve generation of Java classes, you should have these classes available. Rather than take up a lot of space in this chapter, I’ve placed the source for a sample set of classes in Appendix B. You can type these in from the appendix or download them from the book’s web site at http://www.newInstance.com. In either case, you will want to compile them and make them available to your applications for conversion to and from Java.

Converting DTDs to QDML

Example 9-3 shows ...

Get Java & XML Data Binding 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.