Home » xml-commons-external-1.4.01-src » javax » xml » bind » helpers » [javadoc | source]
javax.xml.bind.helpers
abstract public class: AbstractUnmarshallerImpl [javadoc | source]
java.lang.Object
   javax.xml.bind.helpers.AbstractUnmarshallerImpl

All Implemented Interfaces:
    Unmarshaller

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).

Field Summary
protected  boolean validating    whether or not the unmarshaller will validate 
Method from javax.xml.bind.helpers.AbstractUnmarshallerImpl Summary:
createUnmarshalException,   getAdapter,   getAttachmentUnmarshaller,   getEventHandler,   getListener,   getProperty,   getSchema,   getXMLReader,   isValidating,   setAdapter,   setAdapter,   setAttachmentUnmarshaller,   setEventHandler,   setListener,   setProperty,   setSchema,   setValidating,   unmarshal,   unmarshal,   unmarshal,   unmarshal,   unmarshal,   unmarshal,   unmarshal,   unmarshal,   unmarshal,   unmarshal,   unmarshal,   unmarshal,   unmarshal
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.xml.bind.helpers.AbstractUnmarshallerImpl Detail:
 protected UnmarshalException createUnmarshalException(SAXException e) 
    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.

 public A getAdapter(Class<A> type) 
 public AttachmentUnmarshaller getAttachmentUnmarshaller() 
 public ValidationEventHandler getEventHandler() throws JAXBException 
    Return the current event handler or the default event handler if one hasn't been set.
 public Listener getListener() 
 public Object getProperty(String name) throws PropertyException 
    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.
 public Schema getSchema() 
 protected XMLReader getXMLReader() throws JAXBException 
    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.
 public boolean isValidating() throws JAXBException 
    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().

 public  void setAdapter(XmlAdapter adapter) 
 public  void setAdapter(Class<A> type,
    A adapter) 
 public  void setAttachmentUnmarshaller(AttachmentUnmarshaller au) 
 public  void setEventHandler(ValidationEventHandler handler) throws JAXBException 
    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.

 public  void setListener(Listener listener) 
 public  void setProperty(String name,
    Object value) throws PropertyException 
    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.
 public  void setSchema(Schema schema) 
 public  void setValidating(boolean validating) throws JAXBException 
    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.

 public Object unmarshal(Source source) throws JAXBException 
 public final Object unmarshal(InputSource source) throws JAXBException 
 public final Object unmarshal(URL url) throws JAXBException 
 public final Object unmarshal(File f) throws JAXBException 
 public final Object unmarshal(InputStream is) throws JAXBException 
 public final Object unmarshal(Reader reader) throws JAXBException 
 public Object unmarshal(XMLEventReader reader) throws JAXBException 
 public Object unmarshal(XMLStreamReader reader) throws JAXBException 
 abstract protected Object unmarshal(XMLReader reader,
    InputSource source) throws JAXBException
    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.
 public JAXBElement<T> unmarshal(Node node,
    Class<T> expectedType) throws JAXBException 
 public JAXBElement<T> unmarshal(Source source,
    Class<T> expectedType) throws JAXBException 
 public JAXBElement<T> unmarshal(XMLStreamReader reader,
    Class<T> expectedType) throws JAXBException 
 public JAXBElement<T> unmarshal(XMLEventReader reader,
    Class<T> expectedType) throws JAXBException