Class JAXBContextFactory
- java.lang.Object
-
- org.eclipse.persistence.jaxb.JAXBContextFactory
-
public class JAXBContextFactory extends Object
Purpose:An EclipseLink specific JAXBContextFactory. This class can be specified in a jaxb.properties file to make use of EclipseLink's JAXB 2.1 implementation.
Responsibilities:
- Create a JAXBContext from an array of Classes and a Properties object
- Create a JAXBContext from a context path and a classloader
This class is the entry point into in EclipseLink's JAXB 2.1 Runtime. It provides the required factory methods and is invoked by jakarta.xml.bind.JAXBContext.newInstance() to create new instances of JAXBContext. When creating a JAXBContext from a contextPath, the list of classes is derived either from an ObjectFactory class (schema-to-java) or a jaxb.index file (java-to-schema).
- See Also:
JAXBContext
,JAXBContext
,Generator
- Author:
- mmacivor
-
-
Field Summary
Fields Modifier and Type Field Description static String
ANNOTATION_HELPER_KEY
Deprecated.As of release 2.4, replaced by JAXBContextProperties.ANNOTATION_HELPERstatic String
DEFAULT_TARGET_NAMESPACE_KEY
Deprecated.As of release 2.4, replaced by JAXBContextProperties.DEFAULT_TARGET_NAMESPACEstatic String
ECLIPSELINK_OXM_XML_KEY
Deprecated.As of release 2.4, replaced by JAXBContextProperties.OXM_METADATA_SOURCEstatic String
PKG_SEPARATOR
-
Constructor Summary
Constructors Constructor Description JAXBContextFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static jakarta.xml.bind.JAXBContext
createContext(Class[] classesToBeBound, Map properties)
Create a JAXBContext on the array of Class objects.static jakarta.xml.bind.JAXBContext
createContext(Class[] classesToBeBound, Map properties, ClassLoader classLoader)
Create a JAXBContext on the array of Class objects.static jakarta.xml.bind.JAXBContext
createContext(Type[] typesToBeBound, Map properties, ClassLoader classLoader)
Create a JAXBContext on the array of Type objects.static jakarta.xml.bind.JAXBContext
createContext(String contextPath, ClassLoader classLoader)
Create a JAXBContext on context path.static jakarta.xml.bind.JAXBContext
createContext(String contextPath, ClassLoader classLoader, Map properties)
Create a JAXBContext on context path.static jakarta.xml.bind.JAXBContext
createContext(TypeMappingInfo[] typesToBeBound, Map properties, ClassLoader classLoader)
Create a JAXBContext on the array of TypeMappingInfo objects.static Map<String,XmlBindings>
getXmlBindingsFromProperties(Map properties, ClassLoader classLoader)
Convenience method for processing a properties map and creating a map of package names to XmlBindings instances.
-
-
-
Field Detail
-
ECLIPSELINK_OXM_XML_KEY
@Deprecated public static final String ECLIPSELINK_OXM_XML_KEY
Deprecated.As of release 2.4, replaced by JAXBContextProperties.OXM_METADATA_SOURCE
-
DEFAULT_TARGET_NAMESPACE_KEY
@Deprecated public static final String DEFAULT_TARGET_NAMESPACE_KEY
Deprecated.As of release 2.4, replaced by JAXBContextProperties.DEFAULT_TARGET_NAMESPACE
-
ANNOTATION_HELPER_KEY
@Deprecated public static final String ANNOTATION_HELPER_KEY
Deprecated.As of release 2.4, replaced by JAXBContextProperties.ANNOTATION_HELPER
-
PKG_SEPARATOR
public static final String PKG_SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
createContext
public static jakarta.xml.bind.JAXBContext createContext(Class[] classesToBeBound, Map properties) throws jakarta.xml.bind.JAXBException
Create a JAXBContext on the array of Class objects. The JAXBContext will also be aware of classes reachable from the classes in the array.- Throws:
jakarta.xml.bind.JAXBException
-
createContext
public static jakarta.xml.bind.JAXBContext createContext(Class[] classesToBeBound, Map properties, ClassLoader classLoader) throws jakarta.xml.bind.JAXBException
Create a JAXBContext on the array of Class objects. The JAXBContext will also be aware of classes reachable from the classes in the array.- Throws:
jakarta.xml.bind.JAXBException
-
createContext
public static jakarta.xml.bind.JAXBContext createContext(String contextPath, ClassLoader classLoader) throws jakarta.xml.bind.JAXBException
Create a JAXBContext on context path. The JAXBContext will also be aware of classes reachable from the classes on the context path.- Throws:
jakarta.xml.bind.JAXBException
-
createContext
public static jakarta.xml.bind.JAXBContext createContext(String contextPath, ClassLoader classLoader, Map properties) throws jakarta.xml.bind.JAXBException
Create a JAXBContext on context path. The JAXBContext will also be aware of classes reachable from the classes on the context path.- Throws:
jakarta.xml.bind.JAXBException
-
createContext
public static jakarta.xml.bind.JAXBContext createContext(Type[] typesToBeBound, Map properties, ClassLoader classLoader) throws jakarta.xml.bind.JAXBException
Create a JAXBContext on the array of Type objects. The JAXBContext will also be aware of classes reachable from the types in the array. The preferred means of creating a Type aware JAXBContext is to create the JAXBContext with an array of TypeMappingInfo objects.- Throws:
jakarta.xml.bind.JAXBException
-
createContext
public static jakarta.xml.bind.JAXBContext createContext(TypeMappingInfo[] typesToBeBound, Map properties, ClassLoader classLoader) throws jakarta.xml.bind.JAXBException
Create a JAXBContext on the array of TypeMappingInfo objects. The JAXBContext will also be aware of classes reachable from the types in the array. This is the preferred means of creating a Type aware JAXBContext.- Throws:
jakarta.xml.bind.JAXBException
-
getXmlBindingsFromProperties
public static Map<String,XmlBindings> getXmlBindingsFromProperties(Map properties, ClassLoader classLoader)
Convenience method for processing a properties map and creating a map of package names to XmlBindings instances.
It is assumed that the given map's key will be JAXBContextProperties.OXM_METADATA_SOURCE, and the value will be:
1) Map<String, Object> - Object is one of those listed in 3) below 2) List<Object> - Object is one of those listed in 3) below - Bindings file must contain package-name attribute on xml-bindings element 3) One of: - java.io.File - java.io.InputStream - java.io.Reader - java.lang.String - java.net.URL - javax.xml.stream.XMLEventReader - javax.xml.stream.XMLStreamReader - javax.xml.transform.Source - org.eclipse.persistence.jaxb.metadata.MetadataSource - org.w3c.dom.Node - org.xml.sax.InputSource - Bindings file must contain package-name attribute on xml-bindings element
-
-