Purpose:Provide a EclipseLink implementation of the JAXBContext interface.
Responsibilities:
- Create Marshaller instances
- Create Unmarshaller instances
- Create Binder instances
- Create Introspector instances
- Create Validator instances
- Generate Schema Files
This is the EclipseLink JAXB 2.0 implementation of javax.xml.bind.JAXBContext. This class is created by the JAXBContextFactory and is used to create Marshallers, Unmarshallers, Validators, Binders and Introspectors. A JAXBContext can also be used to create Schema Files.
Bootstrapping: When bootstrapping the JAXBContext from a EclipseLink externalized metadata file(s) a number of input options are available. The externalized metadata file (one per package) is passed in through a property when creating the JAXBContext. The key used in the properties map is "eclipselink-oxm-xml". The externalized metadata file can be set in the properties map in one of three ways:
i) For a single externalized metadata file, one of the following can be set in the properties map:
- java.io.File
- java.io.InputStream
- java.io.Reader
- java.net.URL
- javax.xml.stream.XMLEventReader
- javax.xml.stream.XMLStreamReader
- javax.xml.transform.Source
- org.w3c.dom.Node
- org.xml.sax.InputSource
When using one of the above options, the package name must be set via package-name attribute on the xml-bindings element in the externalized metadata file.
ii) For multiple externalized metadata files where the package name is specified within each externalized metadata file, a List can be used. The entries in the List are to be one of the types listed in i) above.
iii) For multiple externalized metadata files where the package name is not specified in each externalized metadata file, a Map can be used. The key must be a String (package name) and each value in the Map (externalized metadata file) is to be one of the types listed in i) above.
Note that in each of the above cases the package name can be set via package-name attribute on the xml-bindings element in the externalized metadata file. If set, any java-type names in the given metadata file that do not contain the package name will have that package name prepended to it. Also note that a List or Map can be used for a single externalized metadata file.
@see javax.xml.bind.JAXBContext
@see org.eclipse.persistence.jaxb.JAXBMarshaller
@see org.eclipse.persistence.jaxb.JAXBUnmarshaller
@see org.eclipse.persistence.jaxb.JAXBBinder
@see org.eclipse.persistence.jaxb.JAXBIntrospector
@see org.eclipse.persistence.jaxb.JAXBContextProperties
@author mmacivor