| java.lang.Object javax.xml.bind.helpers.AbstractUnmarshallerImpl
AbstractUnmarshallerImpl | abstract public class AbstractUnmarshallerImpl implements Unmarshaller(Code) | | Partial default Unmarshaller implementation.
This class provides a partial default implementation for the
javax.xml.bind.Unmarshaller interface.
A JAXB Provider has to implement five methods (getUnmarshallerHandler,
unmarshal(Node), unmarshal(XMLReader,InputSource),
unmarshal(XMLStreamReader), and unmarshal(XMLEventReader).
author: author: - Kohsuke Kawaguchi, Sun Microsystems, Inc.
author:
version: $Revision: 1.14 $ $Date: 2006/03/08 17:01:00 $ See Also: javax.xml.bind.Unmarshaller since: JAXB1.0 |
validating | protected boolean validating(Code) | | whether or not the unmarshaller will validate
|
createUnmarshalException | protected UnmarshalException createUnmarshalException(SAXException e)(Code) | | Creates an UnmarshalException from a SAXException.
This is an utility method provided for the derived classes.
When a provider-implemented ContentHandler wants to throw a
JAXBException, it needs to wrap the exception by a SAXException.
If the unmarshaller implementation blindly wrap SAXException
by JAXBException, such an exception will be a JAXBException
wrapped by a SAXException wrapped by another JAXBException.
This is silly.
This method checks the nested exception of SAXException
and reduce those excessive wrapping.
the resulting UnmarshalException |
getEventHandler | public ValidationEventHandler getEventHandler() throws JAXBException(Code) | | Return the current event handler or the default event handler if one
hasn't been set.
the current ValidationEventHandler or the default event handlerif it hasn't been set throws: JAXBException - if an error was encountered while getting thecurrent event handler |
getListener | public Listener getListener()(Code) | | |
getProperty | public Object getProperty(String name) throws PropertyException(Code) | | Default implementation of the getProperty method always
throws PropertyException since there are no required
properties. If a provider needs to handle additional
properties, it should override this method in a derived class.
|
getXMLReader | protected XMLReader getXMLReader() throws JAXBException(Code) | | Obtains a configured XMLReader.
This method is used when the client-specified
SAXSource object doesn't have XMLReader.
Unmarshaller is not re-entrant, so we will
only use one instance of XMLReader.
|
isValidating | public boolean isValidating() throws JAXBException(Code) | | Indicates whether or not the Unmarshaller is configured to validate
during unmarshal operations.
Note: I named this method isValidating() to stay in-line
with JAXP, as opposed to naming it getValidating().
true if the Unmarshaller is configured to validate duringunmarshal operations, false otherwise throws: JAXBException - if an error occurs while retrieving the validatingflag |
setAdapter | public void setAdapter(Class<A> type, A adapter)(Code) | | |
setEventHandler | public void setEventHandler(ValidationEventHandler handler) throws JAXBException(Code) | | Allow an application to register a validation event handler.
The validation event handler will be called by the JAXB Provider if any
validation errors are encountered during calls to any of the
unmarshal methods. If the client application does not register
a validation event handler before invoking the unmarshal methods, then
all validation events will be silently ignored and may result in
unexpected behaviour.
Parameters: handler - the validation event handler throws: JAXBException - if an error was encountered while setting theevent handler |
setListener | public void setListener(Listener listener)(Code) | | |
setProperty | public void setProperty(String name, Object value) throws PropertyException(Code) | | Default implementation of the setProperty method always
throws PropertyException since there are no required
properties. If a provider needs to handle additional
properties, it should override this method in a derived class.
|
setValidating | public void setValidating(boolean validating) throws JAXBException(Code) | | Specifies whether or not the Unmarshaller should validate during
unmarshal operations. By default, the Unmarshaller does
not validate.
This method may only be invoked before or after calling one of the
unmarshal methods.
Parameters: validating - true if the Unmarshaller should validate duringunmarshal, false otherwise throws: JAXBException - if an error occurred while enabling or disablingvalidation at unmarshal time |
unmarshal | abstract protected Object unmarshal(XMLReader reader, InputSource source) throws JAXBException(Code) | | Unmarshals an object by using the specified XMLReader and the InputSource.
The callee should call the setErrorHandler method of the XMLReader
so that errors are passed to the client-specified ValidationEventHandler.
|
|
|