Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle TopLink
11g Release 1 (11.1.1)

E28847-01


org.eclipse.persistence.jaxb
Class JAXBContextFactory

java.lang.Object
  extended by org.eclipse.persistence.jaxb.JAXBContextFactory


public class JAXBContextFactory
extends java.lang.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:

This class is the entry point into in EclipseLink's JAXB 2.1 Runtime. It provides the required factory methods and is invoked by javax.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).

Author:
mmacivor
See Also:
JAXBContext, JAXBContext, Generator

Field Summary
static java.lang.String ANNOTATION_HELPER_KEY
           
static java.lang.String DEFAULT_TARGET_NAMESPACE_KEY
           
static java.lang.String ECLIPSELINK_OXM_XML_KEY
           
static java.lang.String PKG_SEPARATOR
           

 

Constructor Summary
JAXBContextFactory()
           

 

Method Summary
static javax.xml.bind.JAXBContext createContext(java.lang.Class[] classesToBeBound, java.util.Map properties)
          Create a JAXBContext on the array of Class objects.
static javax.xml.bind.JAXBContext createContext(java.lang.Class[] classesToBeBound, java.util.Map properties, java.lang.ClassLoader classLoader)
          Create a JAXBContext on the array of Class objects.
static javax.xml.bind.JAXBContext createContext(java.lang.String contextPath, java.lang.ClassLoader classLoader)
          Create a JAXBContext on context path.
static javax.xml.bind.JAXBContext createContext(java.lang.String contextPath, java.lang.ClassLoader classLoader, java.util.Map properties)
          Create a JAXBContext on context path.
static javax.xml.bind.JAXBContext createContext(java.lang.reflect.Type[] typesToBeBound, java.util.Map properties, java.lang.ClassLoader classLoader)
          Create a JAXBContext on the array of Type objects.
static javax.xml.bind.JAXBContext createContext(TypeMappingInfo[] typesToBeBound, java.util.Map properties, java.lang.ClassLoader classLoader)
          Create a JAXBContext on the array of TypeMappingInfo objects.
private static XmlBindings getXmlBindings(java.lang.Object metadata, java.lang.ClassLoader classLoader, java.util.Map<java.lang.String,java.lang.Object> properties)
          Convenience method for creating an XmlBindings object based on a given Object.
static java.util.Map<java.lang.String,XmlBindings> getXmlBindingsFromProperties(java.util.Map properties, java.lang.ClassLoader classLoader)
          Convenience method for processing a properties map and creating a map of package names to XmlBindings instances.
private static java.util.Map<java.lang.String,java.util.List<XmlBindings>> processBindingFile(java.util.Map<java.lang.String,java.util.List<XmlBindings>> originalBindings, java.lang.Object bindingHandle, java.lang.ClassLoader classLoader, java.util.Map<java.lang.String,java.lang.Object> properties)
          Processing a bindings file and add it to a given Map of package name to binding files.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

ECLIPSELINK_OXM_XML_KEY

public static final java.lang.String ECLIPSELINK_OXM_XML_KEY
See Also:
Constant Field Values

DEFAULT_TARGET_NAMESPACE_KEY

public static final java.lang.String DEFAULT_TARGET_NAMESPACE_KEY
See Also:
Constant Field Values

ANNOTATION_HELPER_KEY

public static final java.lang.String ANNOTATION_HELPER_KEY
See Also:
Constant Field Values

PKG_SEPARATOR

public static final java.lang.String PKG_SEPARATOR
See Also:
Constant Field Values

Constructor Detail

JAXBContextFactory

public JAXBContextFactory()

Method Detail

createContext

public static javax.xml.bind.JAXBContext createContext(java.lang.Class[] classesToBeBound,
                                                       java.util.Map properties)
                                                throws javax.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:
javax.xml.bind.JAXBException

createContext

public static javax.xml.bind.JAXBContext createContext(java.lang.Class[] classesToBeBound,
                                                       java.util.Map properties,
                                                       java.lang.ClassLoader classLoader)
                                                throws javax.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:
javax.xml.bind.JAXBException

createContext

public static javax.xml.bind.JAXBContext createContext(java.lang.String contextPath,
                                                       java.lang.ClassLoader classLoader)
                                                throws javax.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:
javax.xml.bind.JAXBException

createContext

public static javax.xml.bind.JAXBContext createContext(java.lang.String contextPath,
                                                       java.lang.ClassLoader classLoader,
                                                       java.util.Map properties)
                                                throws javax.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:
javax.xml.bind.JAXBException

createContext

public static javax.xml.bind.JAXBContext createContext(java.lang.reflect.Type[] typesToBeBound,
                                                       java.util.Map properties,
                                                       java.lang.ClassLoader classLoader)
                                                throws javax.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:
javax.xml.bind.JAXBException

createContext

public static javax.xml.bind.JAXBContext createContext(TypeMappingInfo[] typesToBeBound,
                                                       java.util.Map properties,
                                                       java.lang.ClassLoader classLoader)
                                                throws javax.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:
javax.xml.bind.JAXBException

getXmlBindingsFromProperties

public static java.util.Map<java.lang.String,XmlBindings> getXmlBindingsFromProperties(java.util.Map properties,
                                                                                       java.lang.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 ECLIPSELINK_OXM_XML_KEY, and the value will be: 1) Map<String, Object> - Object is one of those listed in 3) below 2) List- 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.net.URL - javax.xml.stream.XMLEventReader - javax.xml.stream.XMLStreamReader - javax.xml.transform.Source - org.w3c.dom.Node - org.xml.sax.InputSource - Bindings file must contain package-name attribute on xml-bindings element

processBindingFile

private static java.util.Map<java.lang.String,java.util.List<XmlBindings>> processBindingFile(java.util.Map<java.lang.String,java.util.List<XmlBindings>> originalBindings,
                                                                                              java.lang.Object bindingHandle,
                                                                                              java.lang.ClassLoader classLoader,
                                                                                              java.util.Map<java.lang.String,java.lang.Object> properties)
Processing a bindings file and add it to a given Map of package name to binding files.
Parameters:
originalBindings - Map of bindings to be updated
bindingHandle - handle to bindings file
classLoader -
Returns:

getXmlBindings

private static XmlBindings getXmlBindings(java.lang.Object metadata,
                                          java.lang.ClassLoader classLoader,
                                          java.util.Map<java.lang.String,java.lang.Object> properties)
Convenience method for creating an XmlBindings object based on a given Object. The method will load the eclipselink metadata model and unmarshal the Object. This assumes that the Object represents the eclipselink-oxm.xml metadata file to be unmarshalled.
Parameters:
metadata - assumed to be one of: File, InputSource, InputStream, Reader, Source

Copyright © 1998, 2012, Oracle. All Rights Reserved.