Additional Features

Like the other data binding frameworks, Quick has several additional features that are useful. Some of these features may turn out to be exactly what you need and will help you decide whether Quick is useful for your own programming needs.

Class Generation

As mentioned earlier, Quick does not consider class generation from DTDs a standard part of its process flow. However, it does provide class generation, which is useful when using Quick in more traditional data binding applications. For the process to work, you will need a QJML binding schema, such as the one shown in Example 9-5. Of course, any modifications you need to make to ensure correct mappings should be made before starting the process. Once you’ve got your QJML schema set up as you like it, you can use the cfgQjml2Java script to generate Java classes:

C:\dev\javajaxb\ch09\src\xml>cfgQjml2Java -in=po.qjml -out=..\generated
  
C:\dev\javajaxb\ch09\src\xml>call cfg.bat 
    classpath:///com/jxml/quick/util/qjml2java/qjml2java.config 
    -in po.qjml -out ..\generated
  
C:\dev\javajaxb\ch09\src\xml>call quickClasspath.bat
creating directories for ..\generated\javajaxb\po\PurchaseOrder.java
new file: ..\generated\javajaxb\po\PurchaseOrder.java
new file: ..\generated\javajaxb\po\Order.java
new file: ..\generated\javajaxb\po\Stock.java

This is pretty basic and shouldn’t be too confusing after already having used JAXB, Zeus, and Castor. You can then compile these classes and use them in your application. This is useful when ...

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.