User Commands                                             xjc(1M)

NAME
     xjc - transforms, or binds, a source XML schema to a set  of
     JAXB content classes in the Java programming language

SYNOPSIS
     xjc  [[ options ...]] [[ schema file / URL / dir ...  ]]  [[
     -b bindinfo ... ]]

DESCRIPTION
     The XJC compiler transforms, or binds, a source  XML  schema
     to  a  set  of  JAXB content classes in the Java programming
     language.

     Invoking the xjc command without  specifying  any  arguments
     outputs the usage information.

OPTIONS
     -nv                     Disable strict schema validation. By
                             default,  the  XJC  binding compiler
                             performs strict  validation  of  the
                             source  schema before processing it.
                             This does not mean that the  binding
                             compiler  will not perform any vali-
                             dation; it  simply  means  that  the
                             compiler  will  perform  less-strict
                             validation.

     -extension              By default, the XJC binding compiler
                             strictly enforces the rules outlined
                             in the Compatibility chapter of  the
                             JAXB  Specification.  In the default
                             (strict) mode, you are also  limited
                             to using only the binding customiza-
                             tions defined in the  specification.
                             By  using  the-extension switch, you
                             will be allowed to use the JAXB Ven-
                             dor Extensions.

     -b file                 Specify one or more external binding
                             files to process. (Each binding file
                             must have it's  own-b  switch.)  The
                             syntax of the external binding files
                             is extremely flexible. You may  have
                             a  single binding file that contains
                             customizations for multiple  schemas
                             or  you can break the customizations
                             into  multiple  bindings  files.  In
                             addition, the ordering of the schema

                             files and binding files on the  com-
                             mand line does not matter.

     -d directory             Specify an alternate output  direc-
                             tory.  By  default,  the XJC binding
                             compiler will generate the Java con-
                             tent  classes  in the current direc-
                             tory.   The  output  directory  must
                             already  exist; the XJC binding com-
                             piler will not create it for you.

     -p package              Specify a target package to override
                             any  binding customization for pack-
                             age name  and  the  default  package
                             name   algorithm   defined   in  the
                             specification.

     -httpproxy proxy        Specify the  HTTP/HTTPS  proxy.  The
                             format                            is
                             [user[:password]@]proxyHost[:proxyPort].
                             The  old  -host    and -port options
                             are still supported by the Reference
                             Implementation  for backwards compa-
                             tibility, but they have been  depre-
                             cated.

     -classpath arg          Specify where to find client  appli-
                             cation   class  files  used  by  the
                             <jxb:javaType>  and <xjc:superClass>
                             customizations.

     -catalog file           Specify  catalog  files  to  resolve
                             external  entity  references.   Sup-
                             ports TR9401,  XCatalog,  and  OASIS
                             XML  Catalog format. For more infor-
                             mation, please read the  XML  Entity
                             and  URI Resolvers document or exam-
                             ine  the   catalog-resolver   sample
                             application.

     -readOnly               Force the XJC  binding  compiler  to
                             mark   the  generated  Java  sources
                             read-only. By default, the XJC bind-
                             ing  compiler does not write-protect
                             the Java source files it generates.

     -npa                    Supress the  generation  of  package
                             level  annotations  into **/package-
                             info.java. Using this switch  causes
                             the  generated  code  to internalize
                             those  annotations  into  the  other
                             generated classes.

     -xmlschema              Treat  input  schemas  as  W3C   XML
                             Schema  (default).  If  you  do  not
                             specify  this  switch,  your   input
                             schemas  will  be treated as W3C XML
                             Schema.

     -verbose                Display  compiler  output,  such  as
                             progress information and warnings.

     -quiet                  Suppress compiler output.

     -help                   Display a brief summary of the  com-
                             piler switches.

     -version                Display the compiler version  infor-
                             mation.

EXTENSIONS
     -Xlocator               Enable source location  support  for
                             generated code..

     -Xsync-methods          Generate accessor methods  with  the
                             synchronized keyword.

     -mark-generated         Mark the  generated  code  with  the
                             -@javax.annotation.Generated annota-
                             tion.

COMPILER RESTRICTIONS
     In general, it is safest to compile all related schemas as a
     single unit with the same binding compiler switches.

     Please keep the following list of restrictions in mind  when
     running  xjc. Most of these issues only apply when compiling
     multiple schemas with multiple invocations of xjc.

       o  To compile multiple schemas at the same time, keep  the
          following  precedence rules for the target Java package
          name in mind:

          1.  The -p command line option takes the  highest  pre-
              cedence.

          2.  <jaxb:package> customization

          3.   If targetNamespace is declared, apply the  target-
              Namespace -> Java package name algorithm defined in
              the specification.

          4.  If notargetNamespace is declared, use  a  hardcoded
              package named "generated".

  o   It is not legal to have more than one <jaxb:schemaBindings>
     per  namespace,  so  it is impossible to have two schemas in
     the same target namespace compiled into different Java pack-
     ages.

  o  All schemas being compiled into the same Java  package  must
     be  submitted  to the XJC binding compiler at the same time;
     they cannot be compiled independently and work as expected.

  o  Element substitution groups spread  across  multiple  schema
     files must be compiled at the same time.

EXAMPLES
     Example 1: Using xjc to compile  schema  and  put  generated
     Java sources in current directory

     xjc po.xsd

     Compiles the po.xsd schema.  Generated Java sources will  be
     placed in the current directory.

     Example 2: Using xjc to compile  schema  and  put  generated
     Java sources in a specified package under the current direc-
     tory

     xjc -p org.acme.po po.xsd

     Compile the po.xsd schema.  Generated Java sources  will  be
     placed  in the current directory under the org.acme.po pack-
     age.

     Example 3: Using xjc to compile  schema  and  put  generated
     Java sources in specified package under specified directory

     xjc -d gen-src -p org.acme.po po.xsd

     Compile the po.xsd schema.  Generated Java sources  will  be
     placed  in the gen-src directory under the org.acme.po pack-
     age.

     Example 4: Using xjc to compile schema using binding custom-
     izations and put generated Java sources in current directory

     xjc po.xsdxjc -b bindings1.xjb po.xsd

     Compile the "po.xsd"po.xsd schema using the binding customi-
     zations  from bindings1.xjb.  Generated Java sources will be
     placed in the current directory.

     Example 5: Using xjc to compile schema in selected directory
     and put generated Java sources in specified directory

     xjc -d gen-src schemadir

     Compile all schema files in the schemadir directory.
      Generated Java sources will be placed in the gen-src direc-
     tory.

     You could also specify one or more schema files  to  compile
     and the XJC compiler will compile only the specified files.

SEE ALSO
     schemagen(1M)
