Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle TopLink API Reference 10g Release 3 (10.1.3) B13698-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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

Method Summary
`XMLMarshaller` | `createMarshaller()` Create a new XMLMarshaller
`XMLUnmarshaller` | `createUnmarshaller()` Create a new XMLUnmarshaller
`XMLValidator` | `createValidator()` Create a new XMLValidator

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

Constructor Detail

### 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(Project project)

  Create a new XMLContext based on the specified project
Parameters:
  `project` - A TopLink project

Method Detail

### createUnmarshaller

    public XMLUnmarshaller createUnmarshaller()

  Create a new XMLUnmarshaller
  Returns:
    An XMLUnmarshaller 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

Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 1998, 2006, Oracle. All Rights Reserved.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD