javax.xml.bind.helpers
public abstract class AbstractUnmarshallerImpl extends Object implements Unmarshaller
This is an abstract default implementation of an Unmarshaller. Subclasses only need to implement getUnmarshallerHandler, unmarshal, and AbstractUnmarshallerImpl.
Since: JAXB1.0
Constructor Summary | |
---|---|
AbstractUnmarshallerImpl() Creates a new instance of AbstractUnmarshallerImpl. |
Method Summary | |
---|---|
protected UnmarshalException | createUnmarshalException(SAXException pException) Helper method to concert a org.xml.sax.SAXException into an UnmarshalException. |
ValidationEventHandler | getEventHandler() |
Object | getProperty(String pName) Always throws a PropertyException, because the default implementation does not support any properties. |
protected XMLReader | getXMLReader() Creates a configured org.xml.sax.XMLReader. |
boolean | isValidating() |
void | setEventHandler(ValidationEventHandler pHandler) |
void | setProperty(String pName, Object pValue) Always throws a PropertyException, because the default implementation does not support any properties. |
void | setValidating(boolean pValidating) |
Object | unmarshal(Source pSource) |
protected abstract Object | unmarshal(XMLReader pReader, InputSource pSource) Unmarshals an object by using the given instance
of org.xml.sax.XMLReader to parse the XML
document read from the byte or character stream
given by the org.xml.sax.InputSource
The implementation should call the method org.xml.sax.XMLReader#setErrorHandler(org.xml.sax.ErrorHandler) in order to pass errors provided by the SAX parser to the ValidationEventHandler provided by the client. |
Object | unmarshal(InputSource pSource) |
Object | unmarshal(URL pURL) |
Object | unmarshal(File pFile) |
Object | unmarshal(InputStream pSource) |
Creates a new instance of AbstractUnmarshallerImpl.
Helper method to concert a org.xml.sax.SAXException into an UnmarshalException.
Parameters: pException If the parameter contains a nested instance of UnmarshalException, throws that instance. Otherwise wraps the parameter in a new UnmarshalException and throws that.
Always throws a PropertyException, because the default implementation does not support any properties. If you want to change this, override the class.
Throws: IllegalArgumentException The property name was null. PropertyException The name was not null. :-)
Creates a configured org.xml.sax.XMLReader. Unmarshaller is not re-entrant, so we will use a single instance of org.xml.sax.XMLReader.
Throws: JAXBException Encapsulates a javax.xml.parsers.ParserConfigurationException
Always throws a PropertyException, because the default implementation does not support any properties. If you want to change this, override the class.
Throws: IllegalArgumentException The property name was null. PropertyException The name was not null. :-)
Unmarshals an object by using the given instance
of org.xml.sax.XMLReader to parse the XML
document read from the byte or character stream
given by the org.xml.sax.InputSource
pSource
.
The implementation should call the method org.xml.sax.XMLReader#setErrorHandler(org.xml.sax.ErrorHandler) in order to pass errors provided by the SAX parser to the ValidationEventHandler provided by the client.
Throws: JAXBException An error occurred while unmarshalling the JAXB object.