O'Reilly logo

Java & XML Data Binding by Brett McLaughlin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix A. Tools Reference

This appendix deals with the tools used by each data binding framework. The schema compiler tools often have numerous command-line switches available to them, and keeping up with them can be a bit of a pain. This appendix should help.

JAXB

Here’s a summary of the command-line JAXB class generation tool:

C:\dev\jaxb-1.0-ea\lib>java com.sun.tools.xjc.Main
Usage: xjc <schema> [ <binding-schema> ] [ -d <directory> ]
           [ -roots <element-list> ]

Table A-1 lists the meaning of each option.

Table A-1. JAXB xjc options

Flag

Value

Purpose

N/A

DTD to parse

Specify the DTD constraint set to JAXB to generate class from.

N/A

Binding schema to parse

Specify the binding schema (if any) to use for generation options.

-d

Destination directory

Specify the directory to put generated classes in.

-roots

List of XML element names

If a DTD has multiple elements that can be considered the root of a document, this option allows listing of each element. JAXB will use this list for generating classes.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required