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/Runtime/Bootstrapping/From Schema"
m (→Bootstrapping from XML Schema (XSD)) |
m (→Bootstrapping from XML Schema (XSD)) |
||
Line 22: | Line 22: | ||
EclipseLink MOXy uses Sun's XJC (XML-to-Java Compiler) APIs to parse the schema into an in-memory representation and generate DynamicTypes and Mappings. | EclipseLink MOXy uses Sun's XJC (XML-to-Java Compiler) APIs to parse the schema into an in-memory representation and generate DynamicTypes and Mappings. | ||
− | {{tip|To bootstrapp from an XML Schema (XSD), include | + | {{tip|To bootstrapp from an XML Schema (XSD), include <ttt>jaxb-xjc.jar</tt>(from the JAXB reference implementation) on your classpath.}} |
You can pass the XML Schema to DynamicJAXBContextFactory by using: | You can pass the XML Schema to DynamicJAXBContextFactory by using: | ||
*InputStream | *InputStream | ||
*Node | *Node | ||
− | *Source | + | *Source |
==Importing other Schemas / EntityResolvers== | ==Importing other Schemas / EntityResolvers== |
Revision as of 09:26, 3 January 2011
EclipseLink MOXy
EclipseLink | |
Website | |
Download | |
Community | |
Mailing List • Forums • IRC • mattermost | |
Issues | |
Open • Help Wanted • Bug Day | |
Contribute | |
Browse Source |
Key API
Contents
Specifying Bootstrapping from an XML Schema
As with conventional JAXB, the first step is to create a JAXBContext. This is achieved by use of the DynamicJAXBContextFactory class. A DynamicJAXBContext cannot be instantiated directly; it must be created through the factory API.
A DynamicJAXBContext can be created from:
- an XML Schema file (XSD)
- the EclipseLink OXM metadata file
- an EclipseLink Project specified in the EclipseLink sessions.xml file
Bootstrapping from XML Schema (XSD)
With EclipseLink MOXy, you can provide an existing XML schema from which to create a DynamicJAXBContext. EclipseLink will parse the schema and generate DynamicTypes for each complex type.
EclipseLink MOXy uses Sun's XJC (XML-to-Java Compiler) APIs to parse the schema into an in-memory representation and generate DynamicTypes and Mappings.
You can pass the XML Schema to DynamicJAXBContextFactory by using:
- InputStream
- Node
- Source
Importing other Schemas / EntityResolvers
Customizing Generated Mappings with EclipseLink Metadata