|
|
(4 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
− | {{EclipseLink_UserGuide
| + | See http://www.eclipse.org/eclipselink/documentation/2.4/moxy/advanced_concepts008.htm |
− | |info=y
| + | |
− | |toc=n
| + | |
− | |eclipselink=y
| + | |
− | |eclipselinktype=MOXy
| + | |
− | }}
| + | |
− | | + | |
− | =Generating Java Classes from an XML Schema=
| + | |
− | | + | |
− | Use the '''JAXB Compiler''' to generate Java classes from an XML schema. The generated classes will contain JAXB annotations that represent the XML binding metadata.
| + | |
− | | + | |
− | ==Running the JAXB Compiler==
| + | |
− | | + | |
− | Use the '''.sh''' or '''.cmd''' file to run the JAXB compiler:
| + | |
− | | + | |
− | <source lang="text">
| + | |
− | <ECLIPSELINK_HOME>/eclipselink/bin/jaxb-compiler.sh <source-file.xsd> [-options]
| + | |
− | </source>
| + | |
− | | + | |
− | or
| + | |
− | | + | |
− | <source lang="text">
| + | |
− | <ECLIPSELINK_HOME>\eclipselink\bin\jaxb-compiler.cmd <source-file.xsd> [-options]
| + | |
− | </source>
| + | |
− | | + | |
− | This table describes the available JAXB Compiler options:
| + | |
− | | + | |
− | <div>
| + | |
− | {| cellspacing="1" cellpadding="1" border="1" align="left" width="50%" summary="JAXB Compiler Options"
| + | |
− | |+ JAXB Compiler Options
| + | |
− | |-
| + | |
− | | -d ''<directory>''
| + | |
− | | Specifies the output directory for the generated files.
| + | |
− | |-
| + | |
− | | -p ''<package>''
| + | |
− | | Specifies the target package
| + | |
− | |-
| + | |
− | | -classpath ''<arg>''
| + | |
− | | Specifies where to find user class files
| + | |
− | |-
| + | |
− | | -verbose
| + | |
− | | Enables the compiler output
| + | |
− | |-
| + | |
− | | -quiet
| + | |
− | | Disables the compiler output
| + | |
− | |-
| + | |
− | | -version
| + | |
− | | Displays the compiler version information
| + | |
− | |}
| + | |
− | </div>
| + | |
− | | + | |
− | <source lang="none">
| + | |
− | -d <directory> Specifies the output directory for the generated files.
| + | |
− | -p <package> Specifies the target package
| + | |
− | -classpath <arg> Specifies where to find user class files
| + | |
− | -verbose Enables the compiler output
| + | |
− | -quiet Disables the compiler output
| + | |
− | -version Displays the compiler version information
| + | |
− | </source>
| + | |
− | | + | |
− | For example:
| + | |
− | | + | |
− | <source lang="dos">
| + | |
− | jaxb-compiler.sh -d jaxb-compiler-output config/Customer.xsd
| + | |
− | </source>
| + | |
− | | + | |
− | To display a complete list of compiler options, use:
| + | |
− | | + | |
− | <source lang="dos">
| + | |
− | jaxb-compiler.sh -help
| + | |
− | </source>
| + | |
− | | + | |
− | {{EclipseLink_MOXy
| + | |
− | |up= [[EclipseLink/UserGuide/MOXy|MOXy User Guide]]
| + | |
− | |previous=[[EclipseLink/UserGuide/MOXy/Customizing_Schemas|Customizing Schemas]]
| + | |
− | |next= [[EclipseLink/UserGuide/MOXy/Mapping JPA Entities to XML|Mapping JPA Entities to XML]]
| + | |
− | |version=2.2.0 Draft}}
| + | |