Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "EclipseLink/UserGuide/MOXy/Generating Java Classes from an XML Schema"
< EclipseLink | UserGuide | MOXy
Line 46: | Line 46: | ||
<br> | <br> | ||
− | For example: | + | For example: |
<source lang="dos"> | <source lang="dos"> | ||
Line 54: | Line 54: | ||
To display a complete list of compiler options, use: | 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]] | |up= [[EclipseLink/UserGuide/MOXy|MOXy User Guide]] | ||
|previous=[[EclipseLink/UserGuide/MOXy/Customizing_Schemas|Customizing Schemas]] | |previous=[[EclipseLink/UserGuide/MOXy/Customizing_Schemas|Customizing Schemas]] | ||
|next= [[EclipseLink/UserGuide/MOXy/Mapping JPA Entities to XML|Mapping JPA Entities to XML]] | |next= [[EclipseLink/UserGuide/MOXy/Mapping JPA Entities to XML|Mapping JPA Entities to XML]] | ||
|version=2.2.0 Draft}} | |version=2.2.0 Draft}} |
Revision as of 11:23, 17 March 2011
EclipseLink MOXy
EclipseLink | |
Website | |
Download | |
Community | |
Mailing List • Forums • IRC • mattermost | |
Issues | |
Open • Help Wanted • Bug Day | |
Contribute | |
Browse Source |
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:
<ECLIPSELINK_HOME>/eclipselink/bin/jaxb-compiler.sh <source-file.xsd> [-options]
or
<ECLIPSELINK_HOME>\eclipselink\bin\jaxb-compiler.cmd <source-file.xsd> [-options]
This table describes the available 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 |
For example:
jaxb-compiler.sh -d jaxb-compiler-output config/Customer.xsd
To display a complete list of compiler options, use:
jaxb-compiler.sh -help