blob: a739d7d7acb89f37d86eab059f987797af2c6444 [file] [log] [blame]
bpatel87d64cc2010-07-14 15:42:06 -07001." Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
duke6e45e102007-12-01 00:00:00 +00002." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3."
4." This code is free software; you can redistribute it and/or modify it
5." under the terms of the GNU General Public License version 2 only, as
6." published by the Free Software Foundation.
7."
8." This code is distributed in the hope that it will be useful, but WITHOUT
9." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11." version 2 for more details (a copy is included in the LICENSE file that
12." accompanied this code).
13."
14." You should have received a copy of the GNU General Public License version
15." 2 along with this work; if not, write to the Free Software Foundation,
16." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17."
ohair2283b9d2010-05-25 15:58:33 -070018." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19." or visit www.oracle.com if you need additional information or have any
20." questions.
duke6e45e102007-12-01 00:00:00 +000021."
bpatel87d64cc2010-07-14 15:42:06 -070022.TH xjc 1 "02 Jun 2010"
duke6e45e102007-12-01 00:00:00 +000023
24.LP
25.ad c
tbell16c34dd2009-05-04 18:28:26 -070026.SH "Name"
duke6e45e102007-12-01 00:00:00 +000027xjc \- Java(TM) Architecture for XML Binding
28.br
tbell16c34dd2009-05-04 18:28:26 -070029Binding Compiler
30.LP
31\f3Specification Version:\fP 2.1
duke6e45e102007-12-01 00:00:00 +000032.br
tbell16c34dd2009-05-04 18:28:26 -070033\f3Reference Implementation (RI) Version:\fP 2.1.3 .ad l
duke6e45e102007-12-01 00:00:00 +000034
35.LP
36.SH "Launching xjc"
37.LP
38.LP
tbell16c34dd2009-05-04 18:28:26 -070039The binding compiler can be launched using the appropriate \f2xjc\fP shell script in the \f2bin\fP directory for your platform. We also provide an Ant task to run the binding complier \- see the instructions for
40.na
41\f2using the XJC Ant task\fP @
42.fi
43https://jaxb.dev.java.net/nonav/2.1.3/docs/xjcTask.html.
duke6e45e102007-12-01 00:00:00 +000044.LP
45.RS 3
46
47.LP
48.LP
tbell16c34dd2009-05-04 18:28:26 -070049\f2% xjc \-help\fP
duke6e45e102007-12-01 00:00:00 +000050.LP
51.RE
duke6e45e102007-12-01 00:00:00 +000052\f3Output\fP
53.LP
54.RS 3
55
56.LP
57.nf
58\f3
59.fl
60Usage: xjc [\-options ...] <schema_file/URL/dir> ... [\-b <bindinfo>] ...
61.fl
62Options:
63.fl
64 \-nv : do not perform strict validation of the input schema(s)
65.fl
66 \-extension : allow vendor extensions \- do not strictly follow the
67.fl
68 Compatibility Rules and App E.2 from the JAXB Spec
69.fl
tbell16c34dd2009-05-04 18:28:26 -070070 \-b <file/dir> : specify external bindings files (each <file> must have its own \-b)
71.fl
72 If a directory is given, **/*.xjb is searched
duke6e45e102007-12-01 00:00:00 +000073.fl
74 \-d <dir> : generated files will go into this directory
75.fl
76 \-p <pkg> : specifies the target package
77.fl
78 \-httpproxy <proxy> : set HTTP/HTTPS proxy. Format is [user[:password]@]proxyHost:proxyPort
79.fl
80 \-httpproxyfile <file>: set the proxy string (same format as above).
81.fl
82 \-classpath <arg> : specify where to find user class files
83.fl
84 \-catalog <file> : specify catalog files to resolve external entity references
85.fl
86 support TR9401, XCatalog, and OASIS XML Catalog format.
87.fl
88 \-readOnly : generated files will be in read\-only mode
89.fl
90 \-npa : suppress generation of package level annotations (**/package\-info.java)
91.fl
tbell16c34dd2009-05-04 18:28:26 -070092 \-no\-header : suppress generation of a file header with timestamp
93.fl
94 \-target 2.0 : behave like XJC 2.0 and generate code that doesnt use any 2.1 features.
95.fl
duke6e45e102007-12-01 00:00:00 +000096 \-xmlschema : treat input as W3C XML Schema (default)
97.fl
98 \-relaxng : treat input as RELAX NG (experimental,unsupported)
99.fl
100 \-relaxng\-compact : treat input as RELAX NG compact syntax (experimental,unsupported)
101.fl
102 \-dtd : treat input as XML DTD (experimental,unsupported)
103.fl
104 \-wsdl : treat input as WSDL and compile schemas inside it (experimental,unsupported)
105.fl
106 \-verbose : be extra verbose
107.fl
108 \-quiet : suppress compiler output
109.fl
110 \-help : display this help message
111.fl
112 \-version : display version information
113.fl
114\fP
115.fi
116.RE
117
118.LP
duke6e45e102007-12-01 00:00:00 +0000119.SH "OPTIONS"
120.LP
121
122.LP
123.RS 3
124.TP 3
125\-nv
126By default, the XJC binding compiler performs strict validation of the source schema before processing it. Use this option to disable strict schema validation. This does not mean that the binding compiler will not perform any validation, it simply means that it will perform less\-strict validation.
127.TP 3
128\-extension
tbell16c34dd2009-05-04 18:28:26 -0700129By default, the XJC binding compiler strictly enforces the rules outlined in the Compatibility chapter of the JAXB Specification. Appendix E.2 defines a set of W3C XML Schema features that are not completely supported by JAXB v1.0. In some cases, you may be allowed to use them in the "\-extension" mode enabled by this switch. In the default (strict) mode, you are also limited to using only the binding customizations defined in the specification. By using the "\-extension" switch, you will be allowed to use the JAXB Vendor Extensions
duke6e45e102007-12-01 00:00:00 +0000130.TP 3
131\-b <file>
tbell16c34dd2009-05-04 18:28:26 -0700132Specify one or more external binding files to process. (Each binding file must have its own \f2"\-b"\fP 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:
duke6e45e102007-12-01 00:00:00 +0000133.RS 3
134
135.LP
136\f2xjc schema1.xsd schema2.xsd schema3.xsd \-b bindings123.xjb\fP
137.br
138\f2xjc schema1.xsd schema2.xsd schema3.xsd \-b bindings1.xjb \-b bindings2.xjb \-b bindings3.xjb\fP
139.RE
140In addition, the ordering of the schema files and binding files on the command line does not matter.
141.TP 3
142\-d <dir>
143By default, the XJC binding compiler will generate the Java content classes in the current directory. Use this option to specify an alternate output directory. The output directory must already exist, the XJC binding compiler will not create it for you.
144.TP 3
145\-p <pkg>
146Specifying a target package via this command\-line option overrides any binding customization for package name and the default package name algorithm defined in the specification.
147.TP 3
148\-httpproxy <proxy>
149Specify the HTTP/HTTPS proxy. The format is [user[:password]@]proxyHost[:proxyPort]. The old \f2\-host\fP and \f2\-port\fP are still supported by the RI for backwards compatibility, but they have been deprecated. Note that the password specified with this option is an argument that is visible to other users who use the \f2top\fP command, for example. For greater security, use \f2\-httpproxyfile\fP, below.
150.TP 3
151\-httpproxyfile <file>
152Specify the HTTP/HTTPS proxy using a file. Same format as above, but the password specified in the file is not visible to other users.
153.TP 3
154\-classpath <arg>
155Specify where to find client application class files used by the \f2<jxb:javaType>\fP and \f2<xjc:superClass>\fP customizations.
156.TP 3
157\-catalog <file>
158Specify catalog files to resolve external entity references. Supports TR9401, XCatalog, and OASIS XML Catalog format. Please read the XML Entity and URI Resolvers document or the \f2catalog\-resolver\fP sample application.
159.TP 3
160\-readOnly
161By default, the XJC binding compiler does not write\-protect the Java source files it generates. Use this option to force the XJC binding compiler to mark the generated Java sources read\-only.
162.TP 3
163\-npa
164Supress 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.
165.TP 3
tbell16c34dd2009-05-04 18:28:26 -0700166\-no\-header
167Supress the generation of a file header comment that includes some note and timestamp. Using this makes the generated code more diff\-friendly.
168.TP 3
169\-target 2.0
170Avoid generating code that relies on any JAXB 2.1 features. This will allow the generated code to run with JAXB 2.0 runtime (such as JavaSE 6.)
171.TP 3
duke6e45e102007-12-01 00:00:00 +0000172\-xmlschema
tbell16c34dd2009-05-04 18:28:26 -0700173Treat input schemas as W3C XML Schema (default). If you do not specify this switch, your input schemas will be treated as W3C XML Schema.
duke6e45e102007-12-01 00:00:00 +0000174.TP 3
175\-relaxng
176Treat input schemas as RELAX NG (experimental, unsupported). Support for RELAX NG schemas is provided as a JAXB Vendor Extension.
177.TP 3
178\-relaxng\-compact
179Treat input schemas as RELAX NG compact syntax(experimental, unsupported). Support for RELAX NG schemas is provided as a JAXB Vendor Extension.
180.TP 3
181\-dtd
182Treat input schemas as XML DTD (experimental, unsupported). Support for RELAX NG schemas is provided as a JAXB Vendor Extension.
183.TP 3
184\-wsdl
185Treat input as WSDL and compile schemas inside it (experimental,unsupported).
186.TP 3
187\-quiet
tbell16c34dd2009-05-04 18:28:26 -0700188Suppress compiler output, such as progress information and warnings.
duke6e45e102007-12-01 00:00:00 +0000189.TP 3
190\-verbose
tbell16c34dd2009-05-04 18:28:26 -0700191Be extra verbose, such as printing informational messages or displaying stack traces upon some errors.
duke6e45e102007-12-01 00:00:00 +0000192.TP 3
193\-help
194Display a brief summary of the compiler switches.
195.TP 3
196\-version
197Display the compiler version information.
198.TP 3
199<schema file/URL/dir>
200Specify one or more schema files to compile. If you specify a directory, then xjc will scan it for all schema files and compile them.
201.RE
202.SS
203Summary of Deprecated and Removed Command Line Options
204.LP
205.RS 3
206
207.LP
208.RS 3
209.TP 3
210\-host & \-port
211These options have been deprecated and replaced with the \f3\-httpproxy\fP option. For backwards compatibility, we will continue to support these options, but they will no longer be documented and may be removed from future releases.
212.TP 3
213\-use\-runtime
214Since the JAXB 2.0 specification has defined a portable runtime, it is no longer necessary for the JAXB RI to generate **/impl/runtime packages. Therefore, this switch is obsolete and has been removed.
215.TP 3
216\-source
217The \-source compatibility switch was introduced in the first JAXB 2.0 Early Access release. We have decided to remove this switch from future releases of JAXB 2.0. If you need to generate 1.0.x code, please use an installation of the 1.0.x codebase.
218.TP 3
219\-Xlocator & \-Xsync\-methods
220These switches have been disabled for now. We plan on releasing this functionality as a separate download in the future.
221.RE
222
223.LP
224.RE
225.SS
226Compiler Restrictions
227.LP
228.LP
229In general, it is safest to compile all related schemas as a single unit with the same binding compiler switches.
230.LP
231.LP
232Please 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.
233.LP
234.RS 3
235.TP 2
236o
237To compile multiple schemas at the same time, keep the following precedence rules for the target Java package name in mind:
238.RS 3
239.TP 3
2401.
241The "\f2\-p\fP" command line option takes the highest precedence.
242.TP 3
2432.
244<\f2jaxb:package\fP> customization
245.TP 3
2463.
247If \f2targetNamespace\fP is declared, apply \f2targetNamespace\fP \-> Java package name algorithm defined in the specification.
248.TP 3
2494.
250If no \f2targetNamespace\fP is declared, use a hardcoded package named "generated".
251.RE
252.TP 2
253o
254It is not legal to have more than one <\f2jaxb:schemaBindings\fP> per namespace, so it is impossible to have two schemas in the same target namespace compiled into different Java packages.
255.TP 2
256o
257All 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.
258.TP 2
259o
260Element substitution groups spread across multiple schema files must be compiled at the same time.
261.RE
262
263.LP
264.SH "See Also"
265.LP
266.RS 3
267.TP 2
268o
tbell16c34dd2009-05-04 18:28:26 -0700269Running the binding compiler (XJC): [
duke6e45e102007-12-01 00:00:00 +0000270.na
tbell16c34dd2009-05-04 18:28:26 -0700271\f2command\-line instructions\fP @
duke6e45e102007-12-01 00:00:00 +0000272.fi
tbell16c34dd2009-05-04 18:28:26 -0700273https://jaxb.dev.java.net/nonav/2.1.3/docs/xjc.html,
duke6e45e102007-12-01 00:00:00 +0000274.na
tbell16c34dd2009-05-04 18:28:26 -0700275\f2using the XJC Ant task\fP @
duke6e45e102007-12-01 00:00:00 +0000276.fi
tbell16c34dd2009-05-04 18:28:26 -0700277https://jaxb.dev.java.net/nonav/2.1.3/docs/xjcTask.html]
duke6e45e102007-12-01 00:00:00 +0000278.TP 2
279o
duke6e45e102007-12-01 00:00:00 +0000280.na
tbell16c34dd2009-05-04 18:28:26 -0700281\f2Java Architecture for XML Binding (JAXB)\fP @
duke6e45e102007-12-01 00:00:00 +0000282.fi
tbell16c34dd2009-05-04 18:28:26 -0700283http://java.sun.com/javase/6/docs/technotes/guides/xml/jaxb/index.html
duke6e45e102007-12-01 00:00:00 +0000284.RE
tbell16c34dd2009-05-04 18:28:26 -0700285
286.LP
duke6e45e102007-12-01 00:00:00 +0000287