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