oracle.toplink.ox
Class XMLContext
java.lang.Object
oracle.toplink.ox.XMLContext
public class XMLContext
- extends java.lang.Object
An XMLContext is created based on TopLink sessions or projects and can then
used to create instances of XMLMarshaller, XMLUnmarshaller and XMLValidator.
There are constructors to create an XMLContext with a single TopLink project
or with a String which is a single TopLink session name or a ':' separated
list of TopLink session names.
Code Sample
XMLContext context = new XMLContext("mySessionName");
XMLMarshaller marshaller = context.createMarshaller();
XMLUnmarshaller unmarshaller = context.createUnmarshaller();
XMLValidator validator = context.createValidator();
The XMLContext is thread-safe. If multiple threads accessing the same XMLContext object
request an XMLMarshaller, each will receive their own instance of XMLMarshaller, so any
state that the XMLMarshaller maintains will be unique to that process. The same is true
of instances of XMLUnmarshaller and XMLValidator.
- See Also:
XMLMarshaller
,
XMLUnmarshaller
,
XMLValidator
Constructor Summary |
XMLContext(Project project)
Create a new XMLContext based on the specified project |
XMLContext(java.lang.String sessionNames)
Create a new XMLContext based on the specified session name or list of
session names |
XMLContext(java.lang.String sessionNames,
java.lang.ClassLoader classLoader)
Create a new XMLContext based on the specified session name or list of
session names |
XMLContext(java.lang.String sessionNames,
java.lang.ClassLoader classLoader,
java.lang.String xmlResource)
Create a new XMLContext based on passed in session names, classloader and
session meta XML. |
XMLContext(java.lang.String sessionNames,
java.lang.String xmlResource)
Create a new XMLContext based on passed in session names and session meta
XML. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XMLContext
public XMLContext(java.lang.String sessionNames)
- Create a new XMLContext based on the specified session name or list of
session names
- Parameters:
sessionNames
- A single session name or multiple session names separated by a :
XMLContext
public XMLContext(java.lang.String sessionNames,
java.lang.ClassLoader classLoader)
- Create a new XMLContext based on the specified session name or list of
session names
- Parameters:
sessionNames
- A single session name or multiple session names separated by a :classLoader
- classloader for loading sessions.xml
XMLContext
public XMLContext(java.lang.String sessionNames,
java.lang.String xmlResource)
- Create a new XMLContext based on passed in session names and session meta
XML.
- Parameters:
sessionNames
- A single session name or multiple session names separated by
a:xmlResource
- path to XML file containing session meta data to initialize
and load sessions.
XMLContext
public XMLContext(java.lang.String sessionNames,
java.lang.ClassLoader classLoader,
java.lang.String xmlResource)
- Create a new XMLContext based on passed in session names, classloader and
session meta XML.
- Parameters:
sessionNames
- A single session name or multiple session names separated by a :classLoader
- classloader for loading sessions.xmlxmlResource
- path to XML file containing session meta data to initialize
and load sessions.
XMLContext
public XMLContext(Project project)
- Create a new XMLContext based on the specified project
- Parameters:
project
- A TopLink project
createUnmarshaller
public XMLUnmarshaller createUnmarshaller()
- Create a new XMLUnmarshaller
- Returns:
- An XMLUnmarshaller based on this XMLContext
createBinder
public XMLBinder createBinder()
- Create a new XMLBinder
- Returns:
- an XMLBinder based on this XMLContext
createMarshaller
public XMLMarshaller createMarshaller()
- Create a new XMLMarshaller
- Returns:
- An XMLMarshaller based on this XMLContext
createValidator
public XMLValidator createValidator()
- Create a new XMLValidator
- Returns:
- An XMLValidator based on this XMLContext
addDescriptorByQName
public void addDescriptorByQName(javax.xml.namespace.QName qName,
XMLDescriptor descriptor)
setupDocumentPreservationPolicy
public void setupDocumentPreservationPolicy(DatabaseSession session)