rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 1 | '\" t |
| 2 | .\" Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. |
| 3 | .\"
|
| 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
| 21 | .\" or visit www.oracle.com if you need additional information or have any
|
| 22 | .\" questions.
|
| 23 | .\"
|
| 24 | .\" Arch: generic |
| 25 | .\" Software: JDK 8 |
| 26 | .\" Date: 21 November 2013 |
| 27 | .\" SectDesc: Java Web Services Tools |
| 28 | .\" Title: xjc.1 |
| 29 | .\" |
| 30 | .if n .pl 99999 |
| 31 | .TH xjc 1 "21 November 2013" "JDK 8" "Java Web Services Tools" |
| 32 | .\" -----------------------------------------------------------------
|
| 33 | .\" * Define some portability stuff
|
| 34 | .\" -----------------------------------------------------------------
|
| 35 | .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 36 | .\" http://bugs.debian.org/507673
|
| 37 | .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
| 38 | .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| 39 | .ie \n(.g .ds Aq \(aq
|
| 40 | .el .ds Aq '
|
| 41 | .\" -----------------------------------------------------------------
|
| 42 | .\" * set default formatting
|
| 43 | .\" -----------------------------------------------------------------
|
| 44 | .\" disable hyphenation
|
| 45 | .nh
|
| 46 | .\" disable justification (adjust text to left margin only)
|
| 47 | .ad l
|
| 48 | .\" -----------------------------------------------------------------
|
| 49 | .\" * MAIN CONTENT STARTS HERE *
|
| 50 | .\" -----------------------------------------------------------------
|
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 51 | |
rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 52 | .SH NAME |
| 53 | xjc \- Compiles an XML schema file into fully annotated Java classes\&. |
| 54 | .SH SYNOPSIS |
| 55 | .sp |
| 56 | .nf |
| 57 | |
| 58 | \fBxjc\fR [ \fIoptions\fR ] \fBschema\fR \fIfile/URL/dir/jar\fR \&.\&.\&. [\fB\-b\fR \fIbindinfo\fR ] \&.\&.\&. |
| 59 | .fi |
| 60 | .sp |
| 61 | .TP |
| 62 | \fIoptions\fR |
| 63 | The command-line options\&. See Options\&. |
| 64 | .TP |
| 65 | schema \fIfile/URL/dir/jar \&.\&.\&.\fR |
| 66 | The location of the XML schema file\&. If \f3dir\fR is specified, then all schema files in it are compiled\&. If \f3jar\fR is specified, then the \f3/META-INF/sun-jaxb\&.episode\fR binding file is compiled\&. |
| 67 | .TP |
| 68 | -b \fIbindinfo\fR |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 69 | .br |
rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 70 | The location of the bindings files\&. |
| 71 | .SH DESCRIPTION |
| 72 | Start the binding compiler with the appropriate \f3xjc\fR shell script in the bin directory for your platform\&. There is also an Ant task to run the binding complier\&. See Using the XJC with Ant at http://jaxb\&.java\&.net/nonav/2\&.1\&.3/docs/xjcTask\&.html |
| 73 | .SH OPTIONS |
| 74 | .TP 0.2i |
| 75 | \(bu |
| 76 | See also Nonstandard Options |
| 77 | .TP 0.2i |
| 78 | \(bu |
| 79 | See also Deprecated and Removed Options |
| 80 | .TP |
| 81 | -nv |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 82 | .br |
rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 83 | 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, but means that it will perform a less-strict validation\&. |
| 84 | .TP |
| 85 | -extension |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 86 | .br |
rgallard | b643545 | 2013-11-25 20:19:02 -0800 | [diff] [blame] | 87 | 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 \f3-extension\fR mode enabled by this switch\&. In the default (strict) mode, you are also limited to using only the binding customization defined in the specification\&. By using the \f3-extension\fR switch, you will be allowed to use the JAXB Vendor Extensions\&. |
| 88 | .TP |
| 89 | -b \fIfile\fR |
| 90 | .br |
| 91 | Specifies one or more external binding files to process\&. Each binding file must have its own \f3-b\fR switch\&. The syntax of the external binding files is flexible\&. You can have a single binding file that contains customization for multiple schemas or you can break the customization into multiple bindings files: \f3xjc schema1\&.xsd schema2\&.xsd schema3\&.xsd -b bindings123\&.xjb\fR\f3xjc schema1\&.xsd schema2\&.xsd schema3\&.xsd -b bindings1\&.xjb -b bindings2\&.xjb -b bindings3\&.xjb\fR\&. In addition, the ordering of the schema files and binding files on the command line does not matter\&. |
| 92 | .TP |
| 93 | -d \fIdir\fR |
| 94 | .br |
| 95 | By default, the XJC binding compiler generates 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 does not create it for you\&. |
| 96 | .TP |
| 97 | -p \fIpkg\fR |
| 98 | .br |
| 99 | When you specify a target package with this command-line option, it overrides any binding customization for the package name and the default package name algorithm defined in the specification\&. |
| 100 | .TP |
| 101 | -httpproxy \fIproxy\fR |
| 102 | .br |
| 103 | Specifies the HTTP or HTTPS proxy in the format \fI[user[:password]@]proxyHost[:proxyPort]\fR\&. The old \f3-host\fR and \f3-port\fR options are still supported by the RI for backward compatibility, but they were deprecated\&. The password specified with this option is an argument that is visible to other users who use the top command\&. For greater security, use the \f3-httpproxyfile\fR option\&. |
| 104 | .TP |
| 105 | -httpproxyfile file |
| 106 | .br |
| 107 | Specifies the HTTP or HTTPS proxy with a file\&. The same format as the \f3-httpproxy\fR option, but the password specified in the file is not visible to other users\&. |
| 108 | .TP |
| 109 | -classpath arg |
| 110 | .br |
| 111 | Specifies where to find client application class files used by the \fIjxb:javaType\fR and xjc:\fIsuperClass\fR customization\&. |
| 112 | .TP |
| 113 | -catalog file |
| 114 | .br |
| 115 | Specifies catalog files to resolve external entity references\&. Supports the TR9401, XCatalog, and OASIS XML Catalog formats\&. See XML Entity and URI Resolvers at http://xerces\&.apache\&.org/xml-commons/components/resolver/resolver-article\&.html |
| 116 | .TP |
| 117 | -readOnly |
| 118 | .br |
| 119 | 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 as read-only\&. |
| 120 | .TP |
| 121 | -npa |
| 122 | .br |
| 123 | Suppresses the generation of package level annotations into \f3**/package-info\&.java\fR\&. Using this switch causes the generated code to internalize those annotations into the other generated classes\&. |
| 124 | .TP |
| 125 | -no-header |
| 126 | .br |
| 127 | Suppresses the generation of a file header comment that includes some note and time stamp\&. Using this makes the generated code more compatible with the \f3diff\fR command\&. |
| 128 | .TP |
| 129 | -target 2\&.0 |
| 130 | .br |
| 131 | Avoids generating code that relies on any JAXB 2\&.1 features\&. This will allow the generated code to run with JAXB 2\&.0 runtime environment (such as Java SE 6)\&. |
| 132 | .TP |
| 133 | -xmlschema |
| 134 | .br |
| 135 | Treats input schemas as W3C XML Schema (default)\&. If you do not specify this switch, then your input schemas are treated as though they are W3C XML Schemas\&. |
| 136 | .TP |
| 137 | -relaxing |
| 138 | .br |
| 139 | Treats input schemas as RELAX NG (experimental and unsupported)\&. Support for RELAX NG schemas is provided as a JAXB Vendor Extension\&. |
| 140 | .TP |
| 141 | -relaxing-compact |
| 142 | .br |
| 143 | Treat input schemas as RELAX NG compact syntax (experimental and unsupported)\&. Support for RELAX NG schemas is provided as a JAXB Vendor Extension\&. |
| 144 | .TP |
| 145 | -dtd |
| 146 | .br |
| 147 | Treats input schemas as XML DTD (experimental and unsupported)\&. Support for RELAX NG schemas is provided as a JAXB Vendor Extension\&. |
| 148 | .TP |
| 149 | -wsdl |
| 150 | .br |
| 151 | Treats input as WSDL and compiles schemas inside it (experimental and unsupported)\&. |
| 152 | .TP |
| 153 | -quiet |
| 154 | .br |
| 155 | Suppress compiler output, such as progress information and warnings\&. |
| 156 | .TP |
| 157 | -verbose |
| 158 | .br |
| 159 | Be extra verbose, such as printing informational messages or displaying stack traces upon some errors\&. |
| 160 | .TP |
| 161 | -help |
| 162 | .br |
| 163 | Displays a brief summary of the compiler switches\&. |
| 164 | .TP |
| 165 | -version |
| 166 | .br |
| 167 | Displays the compiler version information\&. |
| 168 | .TP |
| 169 | \fIschema file/URL/dir\fR |
| 170 | Specifies one or more schema files to compile\&. If you specify a directory, then the \f3xjc\fR command scans it for all schema files and compiles them\&. |
| 171 | .SS NONSTANDARD\ OPTIONS |
| 172 | .TP |
| 173 | -XLocator |
| 174 | .br |
| 175 | Causes the generated code to expose SAX Locator information about the source XML in the Java bean instances after unmarshalling\&. |
| 176 | .TP |
| 177 | -Xsync-methods |
| 178 | .br |
| 179 | Causes all of the generated method signatures to include the \f3synchronized\fR keyword\&. |
| 180 | .TP |
| 181 | -mark-generated |
| 182 | .br |
| 183 | Marks the generated code with the annotation \f3@javax\&.annotation\&.Generated\fR\&. |
| 184 | .TP |
| 185 | -episode file |
| 186 | .br |
| 187 | Generates the specified episode file for separate compilation\&. |
| 188 | .SS DEPRECATED\ AND\ REMOVED\ OPTIONS |
| 189 | .TP |
| 190 | -host & -port |
| 191 | .br |
| 192 | These options are replaced with the \f3-httpproxy\fR option\&. For backward compatibility, these options are supported, but will not be documented and might be removed from future releases\&. |
| 193 | .TP |
| 194 | -use-runtime |
| 195 | .br |
| 196 | Because the JAXB 2\&.0 specification has defined a portable runtime environment, it is no longer necessary for the JAXB RI to generate \f3**/impl/runtime\fRpackages\&. Therefore, this switch is obsolete and was removed\&. |
| 197 | .TP |
| 198 | -source |
| 199 | .br |
| 200 | The \f3-source\fR compatibility switch was introduced in the first JAXB 2\&.0 Early Access release\&. This switch is removed from future releases of JAXB 2\&.0\&. If you need to generate 1\&.0\&.x code, then use an installation of the 1\&.0\&.x code base\&. |
| 201 | .SH COMPILER\ RESTRICTIONS |
| 202 | In general, it is safest to compile all related schemas as a single unit with the same binding compiler switches\&. Keep the following list of restrictions in mind when running the \f3xjc\fR command\&. Most of these issues only apply when you compile multiple schemas with multiple invocations of the \f3xjc\fR command\&. |
| 203 | .PP |
| 204 | To compile multiple schemas at the same time, keep the following precedence rules for the target Java package name in mind: |
| 205 | .TP 0.4i |
| 206 | 1\&. |
| 207 | The \f3-p\fR option has the highest precedence\&. |
| 208 | .TP 0.4i |
| 209 | 2\&. |
| 210 | \fIjaxb:package\fR customization\&. |
| 211 | .TP 0.4i |
| 212 | 3\&. |
| 213 | If \f3targetNamespace\fR is declared, then apply the \f3t\fR\f3argetNamespace\fR to the Java package name algorithm defined in the specification\&. |
| 214 | .TP 0.4i |
| 215 | 4\&. |
| 216 | If no \f3targetNamespace\fR is declared, then use a hard coded package named \f3generated\fR\&. |
| 217 | .PP |
| 218 | You cannot have more than one \fIjaxb:schemaBindings\fR per name space, so it is impossible to have two schemas in the same target name space compiled into different Java packages\&. |
| 219 | .PP |
| 220 | 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\&. |
| 221 | .PP |
| 222 | Element substitution groups that are spread across multiple schema files must be compiled at the same time\&. |
| 223 | .SH SEE\ ALSO |
| 224 | .TP 0.2i |
| 225 | \(bu |
| 226 | Binding Compiler (xjc) at http://jaxb\&.java\&.net/nonav/2\&.2\&.3u1/docs/xjc\&.html |
| 227 | .TP 0.2i |
| 228 | \(bu |
| 229 | Java Architecture for XML Binding (JAXB) at http://www\&.oracle\&.com/technetwork/articles/javase/index-140168\&.html |
| 230 | .RE
|
| 231 | .br
|
| 232 | 'pl 8.5i
|
| 233 | 'bp
|