blob: bf04ce62fa770cd9e2785bec62fddf67e5d2da56 [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001.'" t
2." Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
3." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4."
5." This code is free software; you can redistribute it and/or modify it
6." under the terms of the GNU General Public License version 2 only, as
7." published by the Free Software Foundation.
8."
9." This code is distributed in the hope that it will be useful, but WITHOUT
10." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12." version 2 for more details (a copy is included in the LICENSE file that
13." accompanied this code).
14."
15." You should have received a copy of the GNU General Public License version
16." 2 along with this work; if not, write to the Free Software Foundation,
17." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18."
19." Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20." CA 95054 USA or visit www.sun.com if you need additional information or
21." have any questions.
22." `
23.TH xjc 1 "07 Aug 2006"
24." Generated by html2man
25
26.LP
27.ad c
28.SH NAME
29xjc \- Java(TM) Architecture for XML Binding
30.br
31Binding Compiler \f3Specification Version:\fP 2.0
32.br
33\f3Reference Implementation (RI) Version:\fP 2.0 ea3
34.br
35.ad l
36
37.LP
38.SH "Launching xjc"
39.LP
40.LP
41The 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 using xjc with Ant.
42.LP
43.RS 3
44
45.LP
46\f3For Solaris/Linux\fP
47.LP
48.RS 3
49
50.LP
51.LP
52\f2% /path/to/jaxb/bin/xjc.sh \-help\fP
53.LP
54.RE
55\f3For WindowsNT/2000/XP\fP
56.LP
57.RS 3
58
59.LP
60.LP
61\f2> c:\\path\\to\\jaxb\\bin\\xjc.bat \-help\fP
62.LP
63.RE
64.RE
65.RS 3
66
67.LP
68\f3Output\fP
69.LP
70.RS 3
71
72.LP
73.nf
74\f3
75.fl
76Usage: xjc [\-options ...] <schema_file/URL/dir> ... [\-b <bindinfo>] ...
77.fl
78Options:
79.fl
80 \-nv : do not perform strict validation of the input schema(s)
81.fl
82 \-extension : allow vendor extensions \- do not strictly follow the
83.fl
84 Compatibility Rules and App E.2 from the JAXB Spec
85.fl
86 \-b <file> : specify external bindings files (each <file> must have its own \-b)
87.fl
88 \-d <dir> : generated files will go into this directory
89.fl
90 \-p <pkg> : specifies the target package
91.fl
92 \-httpproxy <proxy> : set HTTP/HTTPS proxy. Format is [user[:password]@]proxyHost:proxyPort
93.fl
94 \-httpproxyfile <file>: set the proxy string (same format as above).
95.fl
96 \-classpath <arg> : specify where to find user class files
97.fl
98 \-catalog <file> : specify catalog files to resolve external entity references
99.fl
100 support TR9401, XCatalog, and OASIS XML Catalog format.
101.fl
102 \-readOnly : generated files will be in read\-only mode
103.fl
104 \-npa : suppress generation of package level annotations (**/package\-info.java)
105.fl
106 \-xmlschema : treat input as W3C XML Schema (default)
107.fl
108 \-relaxng : treat input as RELAX NG (experimental,unsupported)
109.fl
110 \-relaxng\-compact : treat input as RELAX NG compact syntax (experimental,unsupported)
111.fl
112 \-dtd : treat input as XML DTD (experimental,unsupported)
113.fl
114 \-wsdl : treat input as WSDL and compile schemas inside it (experimental,unsupported)
115.fl
116 \-verbose : be extra verbose
117.fl
118 \-quiet : suppress compiler output
119.fl
120 \-help : display this help message
121.fl
122 \-version : display version information
123.fl
124\fP
125.fi
126.RE
127
128.LP
129.RE
130.RS 3
131
132.LP
133\f3Execute the jaxb\-xjc.jar JAR File\fP
134.LP
135.RS 3
136
137.LP
138.LP
139If all else fails, you should be able to execute the \f2jaxb\-xjc.jar\fP file:
140.LP
141.RS 3
142
143.LP
144.RS 3
145.TP 3
146For Solaris/Linux:
147\f2% java \-jar $JAXB_HOME/lib/jaxb\-xjc.jar \-help\fP
148.TP 3
149For Windows:
150\f2> java \-jar %JAXB_HOME%\\lib\\jaxb\-xjc.jar \-help\fP
151.RE
152
153.LP
154.RE
155.LP
156This is equivalent of running "xjc.sh" or "xjc.bat", and it allows you to set the JVM parameters.
157.LP
158.RE
159.RE
160.SH "OPTIONS"
161.LP
162
163.LP
164.RS 3
165.TP 3
166\-nv
167By 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.
168.TP 3
169\-extension
170By 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.
171.TP 3
172\-b <file>
173Specify one or more external binding files to process. (Each binding file must have it's 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:
174.RS 3
175
176.LP
177\f2xjc schema1.xsd schema2.xsd schema3.xsd \-b bindings123.xjb\fP
178.br
179\f2xjc schema1.xsd schema2.xsd schema3.xsd \-b bindings1.xjb \-b bindings2.xjb \-b bindings3.xjb\fP
180.RE
181In addition, the ordering of the schema files and binding files on the command line does not matter.
182.TP 3
183\-d <dir>
184By 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.
185.TP 3
186\-p <pkg>
187Specifying 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.
188.TP 3
189\-httpproxy <proxy>
190Specify 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.
191.TP 3
192\-httpproxyfile <file>
193Specify the HTTP/HTTPS proxy using a file. Same format as above, but the password specified in the file is not visible to other users.
194.TP 3
195\-classpath <arg>
196Specify where to find client application class files used by the \f2<jxb:javaType>\fP and \f2<xjc:superClass>\fP customizations.
197.TP 3
198\-catalog <file>
199Specify 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.
200.TP 3
201\-readOnly
202By 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.
203.TP 3
204\-npa
205Supress 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.
206.TP 3
207\-xmlschema
208treat input schemas as W3C XML Schema (default). If you do not specify this switch, your input schemas will be treated as W3C XML Schema.
209.TP 3
210\-relaxng
211Treat input schemas as RELAX NG (experimental, unsupported). Support for RELAX NG schemas is provided as a JAXB Vendor Extension.
212.TP 3
213\-relaxng\-compact
214Treat input schemas as RELAX NG compact syntax(experimental, unsupported). Support for RELAX NG schemas is provided as a JAXB Vendor Extension.
215.TP 3
216\-dtd
217Treat input schemas as XML DTD (experimental, unsupported). Support for RELAX NG schemas is provided as a JAXB Vendor Extension.
218.TP 3
219\-wsdl
220Treat input as WSDL and compile schemas inside it (experimental,unsupported).
221.TP 3
222\-quiet
223Suppress compiler output, such as progress information and warnings..
224.TP 3
225\-verbose
226Be extra verbose, such as printing informational messages or displaying stack traces upon some errors..
227.TP 3
228\-help
229Display a brief summary of the compiler switches.
230.TP 3
231\-version
232Display the compiler version information.
233.TP 3
234<schema file/URL/dir>
235Specify one or more schema files to compile. If you specify a directory, then xjc will scan it for all schema files and compile them.
236.RE
237.SS
238Summary of Deprecated and Removed Command Line Options
239.LP
240.RS 3
241
242.LP
243.RS 3
244.TP 3
245\-host & \-port
246These 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.
247.TP 3
248\-use\-runtime
249Since 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.
250.TP 3
251\-source
252The \-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.
253.TP 3
254\-Xlocator & \-Xsync\-methods
255These switches have been disabled for now. We plan on releasing this functionality as a separate download in the future.
256.RE
257
258.LP
259.RE
260.SS
261Compiler Restrictions
262.LP
263.LP
264In general, it is safest to compile all related schemas as a single unit with the same binding compiler switches.
265.LP
266.LP
267Please 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.
268.LP
269.RS 3
270.TP 2
271o
272To compile multiple schemas at the same time, keep the following precedence rules for the target Java package name in mind:
273.RS 3
274.TP 3
2751.
276The "\f2\-p\fP" command line option takes the highest precedence.
277.TP 3
2782.
279<\f2jaxb:package\fP> customization
280.TP 3
2813.
282If \f2targetNamespace\fP is declared, apply \f2targetNamespace\fP \-> Java package name algorithm defined in the specification.
283.TP 3
2844.
285If no \f2targetNamespace\fP is declared, use a hardcoded package named "generated".
286.RE
287.TP 2
288o
289It 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.
290.TP 2
291o
292All 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.
293.TP 2
294o
295Element substitution groups spread across multiple schema files must be compiled at the same time.
296.RE
297
298.LP
299.SH "See Also"
300.LP
301.RS 3
302.TP 2
303o
304JAXB 2.0:
305.RS 3
306.TP 2
307*
308.na
309\f2Release Notes\fP @
310.fi
311http://java.sun.com/webservices/docs/2.0/jaxb/ReleaseNotes.html
312.TP 2
313*
314.na
315\f2XJC\fP @
316.fi
317http://java.sun.com/webservices/docs/2.0/jaxb/xjc.html
318.TP 2
319*
320.na
321\f2XJCTask\fP @
322.fi
323http://java.sun.com/webservices/docs/2.0/jaxb/xjcTask.html
324.TP 2
325*
326.na
327\f2SchemaGen\fP @
328.fi
329http://java.sun.com/webservices/docs/2.0/jaxb/schemagen.html
330.TP 2
331*
332.na
333\f2schemagenTask\fP @
334.fi
335http://java.sun.com/webservices/docs/2.0/jaxb/schemagenTask.html
336.TP 2
337*
338.na
339\f2Sample Apps\fP @
340.fi
341http://java.sun.com/webservices/docs/2.0/jaxb/samples.html
342.TP 2
343*
344.na
345\f2Changelog\fP @
346.fi
347http://java.sun.com/webservices/docs/2.0/jaxb/changelog2.html
348.RE
349.TP 2
350o
351JAXB 1.0.x:
352.RS 3
353.TP 2
354*
355.na
356\f2Release Notes\fP @
357.fi
358http://java.sun.com/webservices/docs/2.0/jaxb/jaxb\-1_0.html
359.TP 2
360*
361.na
362\f2Changelog\fP @
363.fi
364http://java.sun.com/webservices/docs/2.0/jaxb/changelog.html
365.RE
366.TP 2
367o
368JAXB RI Extensions:
369.RS 3
370.TP 2
371*
372.na
373\f2Runtime Properties\fP @
374.fi
375http://java.sun.com/webservices/docs/2.0/jaxb/vendorProperties.html
376.TP 2
377*
378.na
379\f2XJC Customizations\fP @
380.fi
381http://java.sun.com/webservices/docs/2.0/jaxb/vendorCustomizations.html
382.TP 2
383*
384.na
385\f2Develop Plugins\fP @
386.fi
387http://java.sun.com/webservices/docs/2.0/jaxb/developPlugins.html
388.RE
389.TP 2
390o
391JAXB RI Schema Languages:
392.RS 3
393.TP 2
394*
395.na
396\f2W3C XML Schema\fP @
397.fi
398http://java.sun.com/webservices/docs/2.0/jaxb/vendorSchemaLangs.html#xschema
399.TP 2
400*
401.na
402\f2RELAX NG\fP @
403.fi
404http://java.sun.com/webservices/docs/2.0/jaxb/vendorSchemaLangs.html#relaxng
405.TP 2
406*
407.na
408\f2DTD\fP @
409.fi
410http://java.sun.com/webservices/docs/2.0/jaxb/vendorSchemaLangs.html#dtd
411.RE
412.TP 2
413o
414JAXB Community:
415.RS 3
416.TP 2
417*
418.na
419\f2Java.net Homepage\fP @
420.fi
421http://jaxb.dev.java.net
422.TP 2
423*
424.na
425\f2Developer interest list\fP @
426.fi
427https://jaxb.dev.java.net/servlets/ProjectMailingListList
428.TP 2
429*
430.na
431\f2FAQ\fP @
432.fi
433https://jaxb.dev.java.net/faq/index.html
434.RE
435.RE
436
437.LP
438