javax.xml.bind
Interface UnmarshallerHandler

All Superinterfaces:
org.xml.sax.ContentHandler
All Known Subinterfaces:
JMUnmarshallerHandler
All Known Implementing Classes:
JMUnmarshallerHandlerImpl

public interface UnmarshallerHandler
extends org.xml.sax.ContentHandler

This interface is the SAX ContentHandler representation of an Unmarshaller, as returned by Unmarshaller.getUnmarshallerHandler(). It can be embedded into a stack of SAX handlers, for example within Apache Cocoon.

The UnmarshallerHandler is reusable: The startDocument() method is expected to perform a reinitialization. Like most other SAX handlers, the UnmarshallerHandler is never thread safe.

Since:
JAXB1.0
Author:
JSR-31

Method Summary
 java.lang.Object getResult()
          Returns the unmarshalled object.
 
Methods inherited from interface org.xml.sax.ContentHandler
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping
 

Method Detail

getResult

java.lang.Object getResult()
                           throws JAXBException,
                                  java.lang.IllegalStateException

Returns the unmarshalled object. This method may be invoked after an endDocument() event only. An IllegalStateException is thrown otherwise.

Returns:
The unmarshalled object, never null. (An IllegalStateException is thrown, if no data is available.
Throws:
JAXBException - An error occurred. Note, that the UnmarshallerHandler throws a SAXException if an error occurs while unmarshalling the object. In such cases the JAXBException is typically nested within the SAXException.
java.lang.IllegalStateException - An endDocument() event has not yet been seen and no data is available.