2
|
1 |
." Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
|
|
2 |
." 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 |
."
|
5506
|
18 |
." 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.
|
2
|
21 |
."
|
2692
|
22 |
.TH xjc 1 "04 May 2009"
|
|
23 |
." Generated from HTML by html2man (author: Eric Armstrong)
|
2
|
24 |
|
|
25 |
.LP
|
|
26 |
.ad c
|
2692
|
27 |
.SH "Name"
|
2
|
28 |
xjc \- Java(TM) Architecture for XML Binding
|
|
29 |
.br
|
2692
|
30 |
Binding Compiler
|
|
31 |
.LP
|
|
32 |
\f3Specification Version:\fP 2.1
|
2
|
33 |
.br
|
2692
|
34 |
\f3Reference Implementation (RI) Version:\fP 2.1.3 .ad l
|
2
|
35 |
|
|
36 |
.LP
|
|
37 |
.SH "Launching xjc"
|
|
38 |
.LP
|
|
39 |
.LP
|
2692
|
40 |
The 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
|
|
41 |
.na
|
|
42 |
\f2using the XJC Ant task\fP @
|
|
43 |
.fi
|
|
44 |
https://jaxb.dev.java.net/nonav/2.1.3/docs/xjcTask.html.
|
2
|
45 |
.LP
|
|
46 |
.RS 3
|
|
47 |
|
|
48 |
.LP
|
|
49 |
.LP
|
2692
|
50 |
\f2% xjc \-help\fP
|
2
|
51 |
.LP
|
|
52 |
.RE
|
|
53 |
\f3Output\fP
|
|
54 |
.LP
|
|
55 |
.RS 3
|
|
56 |
|
|
57 |
.LP
|
|
58 |
.nf
|
|
59 |
\f3
|
|
60 |
.fl
|
|
61 |
Usage: xjc [\-options ...] <schema_file/URL/dir> ... [\-b <bindinfo>] ...
|
|
62 |
.fl
|
|
63 |
Options:
|
|
64 |
.fl
|
|
65 |
\-nv : do not perform strict validation of the input schema(s)
|
|
66 |
.fl
|
|
67 |
\-extension : allow vendor extensions \- do not strictly follow the
|
|
68 |
.fl
|
|
69 |
Compatibility Rules and App E.2 from the JAXB Spec
|
|
70 |
.fl
|
2692
|
71 |
\-b <file/dir> : specify external bindings files (each <file> must have its own \-b)
|
|
72 |
.fl
|
|
73 |
If a directory is given, **/*.xjb is searched
|
2
|
74 |
.fl
|
|
75 |
\-d <dir> : generated files will go into this directory
|
|
76 |
.fl
|
|
77 |
\-p <pkg> : specifies the target package
|
|
78 |
.fl
|
|
79 |
\-httpproxy <proxy> : set HTTP/HTTPS proxy. Format is [user[:password]@]proxyHost:proxyPort
|
|
80 |
.fl
|
|
81 |
\-httpproxyfile <file>: set the proxy string (same format as above).
|
|
82 |
.fl
|
|
83 |
\-classpath <arg> : specify where to find user class files
|
|
84 |
.fl
|
|
85 |
\-catalog <file> : specify catalog files to resolve external entity references
|
|
86 |
.fl
|
|
87 |
support TR9401, XCatalog, and OASIS XML Catalog format.
|
|
88 |
.fl
|
|
89 |
\-readOnly : generated files will be in read\-only mode
|
|
90 |
.fl
|
|
91 |
\-npa : suppress generation of package level annotations (**/package\-info.java)
|
|
92 |
.fl
|
2692
|
93 |
\-no\-header : suppress generation of a file header with timestamp
|
|
94 |
.fl
|
|
95 |
\-target 2.0 : behave like XJC 2.0 and generate code that doesnt use any 2.1 features.
|
|
96 |
.fl
|
2
|
97 |
\-xmlschema : treat input as W3C XML Schema (default)
|
|
98 |
.fl
|
|
99 |
\-relaxng : treat input as RELAX NG (experimental,unsupported)
|
|
100 |
.fl
|
|
101 |
\-relaxng\-compact : treat input as RELAX NG compact syntax (experimental,unsupported)
|
|
102 |
.fl
|
|
103 |
\-dtd : treat input as XML DTD (experimental,unsupported)
|
|
104 |
.fl
|
|
105 |
\-wsdl : treat input as WSDL and compile schemas inside it (experimental,unsupported)
|
|
106 |
.fl
|
|
107 |
\-verbose : be extra verbose
|
|
108 |
.fl
|
|
109 |
\-quiet : suppress compiler output
|
|
110 |
.fl
|
|
111 |
\-help : display this help message
|
|
112 |
.fl
|
|
113 |
\-version : display version information
|
|
114 |
.fl
|
|
115 |
\fP
|
|
116 |
.fi
|
|
117 |
.RE
|
|
118 |
|
|
119 |
.LP
|
|
120 |
.SH "OPTIONS"
|
|
121 |
.LP
|
|
122 |
|
|
123 |
.LP
|
|
124 |
.RS 3
|
|
125 |
.TP 3
|
|
126 |
\-nv
|
|
127 |
By 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.
|
|
128 |
.TP 3
|
|
129 |
\-extension
|
2692
|
130 |
By 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
|
2
|
131 |
.TP 3
|
|
132 |
\-b <file>
|
2692
|
133 |
Specify 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:
|
2
|
134 |
.RS 3
|
|
135 |
|
|
136 |
.LP
|
|
137 |
\f2xjc schema1.xsd schema2.xsd schema3.xsd \-b bindings123.xjb\fP
|
|
138 |
.br
|
|
139 |
\f2xjc schema1.xsd schema2.xsd schema3.xsd \-b bindings1.xjb \-b bindings2.xjb \-b bindings3.xjb\fP
|
|
140 |
.RE
|
|
141 |
In addition, the ordering of the schema files and binding files on the command line does not matter.
|
|
142 |
.TP 3
|
|
143 |
\-d <dir>
|
|
144 |
By 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.
|
|
145 |
.TP 3
|
|
146 |
\-p <pkg>
|
|
147 |
Specifying 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.
|
|
148 |
.TP 3
|
|
149 |
\-httpproxy <proxy>
|
|
150 |
Specify 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.
|
|
151 |
.TP 3
|
|
152 |
\-httpproxyfile <file>
|
|
153 |
Specify the HTTP/HTTPS proxy using a file. Same format as above, but the password specified in the file is not visible to other users.
|
|
154 |
.TP 3
|
|
155 |
\-classpath <arg>
|
|
156 |
Specify where to find client application class files used by the \f2<jxb:javaType>\fP and \f2<xjc:superClass>\fP customizations.
|
|
157 |
.TP 3
|
|
158 |
\-catalog <file>
|
|
159 |
Specify 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.
|
|
160 |
.TP 3
|
|
161 |
\-readOnly
|
|
162 |
By 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.
|
|
163 |
.TP 3
|
|
164 |
\-npa
|
|
165 |
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.
|
|
166 |
.TP 3
|
2692
|
167 |
\-no\-header
|
|
168 |
Supress the generation of a file header comment that includes some note and timestamp. Using this makes the generated code more diff\-friendly.
|
|
169 |
.TP 3
|
|
170 |
\-target 2.0
|
|
171 |
Avoid 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.)
|
|
172 |
.TP 3
|
2
|
173 |
\-xmlschema
|
2692
|
174 |
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.
|
2
|
175 |
.TP 3
|
|
176 |
\-relaxng
|
|
177 |
Treat input schemas as RELAX NG (experimental, unsupported). Support for RELAX NG schemas is provided as a JAXB Vendor Extension.
|
|
178 |
.TP 3
|
|
179 |
\-relaxng\-compact
|
|
180 |
Treat input schemas as RELAX NG compact syntax(experimental, unsupported). Support for RELAX NG schemas is provided as a JAXB Vendor Extension.
|
|
181 |
.TP 3
|
|
182 |
\-dtd
|
|
183 |
Treat input schemas as XML DTD (experimental, unsupported). Support for RELAX NG schemas is provided as a JAXB Vendor Extension.
|
|
184 |
.TP 3
|
|
185 |
\-wsdl
|
|
186 |
Treat input as WSDL and compile schemas inside it (experimental,unsupported).
|
|
187 |
.TP 3
|
|
188 |
\-quiet
|
2692
|
189 |
Suppress compiler output, such as progress information and warnings.
|
2
|
190 |
.TP 3
|
|
191 |
\-verbose
|
2692
|
192 |
Be extra verbose, such as printing informational messages or displaying stack traces upon some errors.
|
2
|
193 |
.TP 3
|
|
194 |
\-help
|
|
195 |
Display a brief summary of the compiler switches.
|
|
196 |
.TP 3
|
|
197 |
\-version
|
|
198 |
Display the compiler version information.
|
|
199 |
.TP 3
|
|
200 |
<schema file/URL/dir>
|
|
201 |
Specify one or more schema files to compile. If you specify a directory, then xjc will scan it for all schema files and compile them.
|
|
202 |
.RE
|
|
203 |
.SS
|
|
204 |
Summary of Deprecated and Removed Command Line Options
|
|
205 |
.LP
|
|
206 |
.RS 3
|
|
207 |
|
|
208 |
.LP
|
|
209 |
.RS 3
|
|
210 |
.TP 3
|
|
211 |
\-host & \-port
|
|
212 |
These 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.
|
|
213 |
.TP 3
|
|
214 |
\-use\-runtime
|
|
215 |
Since 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.
|
|
216 |
.TP 3
|
|
217 |
\-source
|
|
218 |
The \-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.
|
|
219 |
.TP 3
|
|
220 |
\-Xlocator & \-Xsync\-methods
|
|
221 |
These switches have been disabled for now. We plan on releasing this functionality as a separate download in the future.
|
|
222 |
.RE
|
|
223 |
|
|
224 |
.LP
|
|
225 |
.RE
|
|
226 |
.SS
|
|
227 |
Compiler Restrictions
|
|
228 |
.LP
|
|
229 |
.LP
|
|
230 |
In general, it is safest to compile all related schemas as a single unit with the same binding compiler switches.
|
|
231 |
.LP
|
|
232 |
.LP
|
|
233 |
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.
|
|
234 |
.LP
|
|
235 |
.RS 3
|
|
236 |
.TP 2
|
|
237 |
o
|
|
238 |
To compile multiple schemas at the same time, keep the following precedence rules for the target Java package name in mind:
|
|
239 |
.RS 3
|
|
240 |
.TP 3
|
|
241 |
1.
|
|
242 |
The "\f2\-p\fP" command line option takes the highest precedence.
|
|
243 |
.TP 3
|
|
244 |
2.
|
|
245 |
<\f2jaxb:package\fP> customization
|
|
246 |
.TP 3
|
|
247 |
3.
|
|
248 |
If \f2targetNamespace\fP is declared, apply \f2targetNamespace\fP \-> Java package name algorithm defined in the specification.
|
|
249 |
.TP 3
|
|
250 |
4.
|
|
251 |
If no \f2targetNamespace\fP is declared, use a hardcoded package named "generated".
|
|
252 |
.RE
|
|
253 |
.TP 2
|
|
254 |
o
|
|
255 |
It 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.
|
|
256 |
.TP 2
|
|
257 |
o
|
|
258 |
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.
|
|
259 |
.TP 2
|
|
260 |
o
|
|
261 |
Element substitution groups spread across multiple schema files must be compiled at the same time.
|
|
262 |
.RE
|
|
263 |
|
|
264 |
.LP
|
|
265 |
.SH "See Also"
|
|
266 |
.LP
|
|
267 |
.RS 3
|
|
268 |
.TP 2
|
|
269 |
o
|
2692
|
270 |
Running the binding compiler (XJC): [
|
2
|
271 |
.na
|
2692
|
272 |
\f2command\-line instructions\fP @
|
2
|
273 |
.fi
|
2692
|
274 |
https://jaxb.dev.java.net/nonav/2.1.3/docs/xjc.html,
|
2
|
275 |
.na
|
2692
|
276 |
\f2using the XJC Ant task\fP @
|
2
|
277 |
.fi
|
2692
|
278 |
https://jaxb.dev.java.net/nonav/2.1.3/docs/xjcTask.html]
|
2
|
279 |
.TP 2
|
|
280 |
o
|
|
281 |
.na
|
2692
|
282 |
\f2Java Architecture for XML Binding (JAXB)\fP @
|
2
|
283 |
.fi
|
2692
|
284 |
http://java.sun.com/javase/6/docs/technotes/guides/xml/jaxb/index.html
|
2
|
285 |
.RE
|
|
286 |
|
|
287 |
.LP
|
2692
|
288 |
|
|
289 |
.LP
|
2
|
290 |
|