Skip to main content

skip to main content

developerWorks  >  Java technology | XML | Open source  >

JiBX 1.2, Part 2: XML schema to Java code

Generate cleaner, customized Java code from XML schema

developerWorks
Go to the previous pagePage 9 of 14 Go to the next page

Document options
PDF format - Fits A4 and Letter

PDF - Fits A4 and Letter
222 KB (36 pages)

Get Adobe® Reader®

Sample code


My developerWorks needs you!

Connect to your technical community


Rate this tutorial

Help us improve this content


CodeGen command-line parameters

CodeGen supports several additional command line parameters beyond those used in the tutorial code. Table 1 lists the most important options:


Table 1. CodeGen command-line options
CommandPurpose
-c pathPath to input customizations file
-n packageDefault package for no-namespace schema definitions (default is the default package)
-p packageDefault package for all schema definitions (default is to use package generated from each schema namespace)
-s pathSchema root directory path (default is current directory)
-t pathTarget directory path for generated output (default is current directory)
-vVerbose-output flag
-wWipe all files from target directory before generating output (ignored if the target directory is the same as the current directory)

You can also pass global customizations to CodeGen as command-line parameters, without the need to create a customizations file, by using the special -- prefix before the customization attribute value. So to set the same global options as used in the Listing 5 customizations, you'd add --prefer-inline=true --show-schema=false --enumeration-type=simple --generate-all=false to the CodeGen command line. (You can't specify the list of schema components to be included in the generation this way, though, because these are specific to a particular schema.) No quotes are needed for attribute value when you use this technique. If you want to set a customization that takes a list of multiple values, use commas rather than spaces as separators between the individual values. (So to ignore the Type and Group schema name suffixes, for instance, you'd use the command-line --strip-suffixes=Type,Group parameter.)



Back to top



Go to the previous pagePage 9 of 14 Go to the next page