javax.xml.bind

Interface UnmarshallerHandler

public interface UnmarshallerHandler extends ContentHandler

This interface is the SAX {@link org.xml.sax.ContentHandler} representation of an {@link javax.xml.bind.Unmarshaller}, as returned by {@link javax.xml.bind.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
ObjectgetResult()

Returns the unmarshalled object.

Method Detail

getResult

public Object getResult()

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

Returns: The unmarshalled object, never null. (An {@link IllegalStateException} is thrown, if no data is available.

Throws: JAXBException An error occurred. Note, that the {@link UnmarshallerHandler} throws a {@link org.xml.sax.SAXException} if an error occurs while unmarshalling the object. In such cases the {@link JAXBException} is typically nested within the {@link org.xml.sax.SAXException}. IllegalStateException An endDocument() event has not yet been seen and no data is available.