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 XMLUnmarshallerHandler

`java.lang.Object
oracle.toplink.platform.xml.SAXDocumentBuilder
oracle.toplink.ox.XMLUnmarshallerHandler`

All Implemented Interfaces:
  org.xml.sax.ContentHandler

public class XMLUnmarshallerHandler
extends SAXDocumentBuilder

Class used to unmarshal SAX events to objects.

Create an XMLUnmarshallerHandler from an XMLUnmarshaller.
Code Sample
`XMLContext context = new XMLContext("mySessionName");
XMLUnmarshaller unmarshaller = context.createUnmarshaller();
XMLUnmarshallerHandler unmarshallerHandler = unmarshaller.getUnmarshallerHandler();
`

Use the UnmarshallerHandler with an XMLReader
Code Sample
`SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
saxParserFactory.setNamespaceAware(true);
SAXParser saxParser = saxParserFactory.newSAXParser();
XMLReader xmlReader = saxParser.getXMLReader();
xmlReader.setContentHandler(xmlUnmarshallerHandler);
FileInputStream inputStream = new FileInputStream("MyFile.xml");
InputSource inputSource = new InputSource(inputStream);
xmlReader.parse(inputSource);
Object result = xmlUnmarshallerHandler.getResult();
`

XML that can be unmarshalled is XML which has a root tag that corresponds to a default root element on an XMLDescriptor in the TopLink project associated with the XMLContext.

See Also:
  `XMLUnmarshaller`

Method Summary
`void` | `endDocument()`
`java.lang.Object` | `getResult()` Returns the object that was unmarshalled from the SAX events.
`void` | `startDocument()`

Methods inherited from class oracle.toplink.platform.xml.SAXDocumentBuilder
`characters, endElement, endPrefixMapping, getDocument, getInitializedDocument, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startElement, startPrefixMapping`

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

Method Detail

### endDocument

    public void endDocument()
                     throws org.xml.sax.SAXException

  Specified by:
    `endDocument` in interface `org.xml.sax.ContentHandler`
  Overrides:
    `endDocument` in class `SAXDocumentBuilder`
  Throws:
    `org.xml.sax.SAXException`

### startDocument

    public void startDocument()
                       throws org.xml.sax.SAXException

  Specified by:
    `startDocument` in interface `org.xml.sax.ContentHandler`
  Overrides:
    `startDocument` in class `SAXDocumentBuilder`
  Throws:
    `org.xml.sax.SAXException`

### getResult

    public java.lang.Object getResult()

  Returns the object that was unmarshalled from the SAX events.
  Returns:
    the resulting object
  Throws:
    `XMLMarshalException` - if an error occurred during unmarshalling

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