Class JAXBErrorHandler

  • All Implemented Interfaces:
    org.xml.sax.ErrorHandler

    public class JAXBErrorHandler
    extends java.lang.Object
    implements org.xml.sax.ErrorHandler

    Implementation of org.xml.sax.ErrorHandler. When JAXBMarshaller or JAXBUnmarshaller is given a ValidationEventHandler a JAXBErrorHandler is used to wrap it. This ErrorHandler is then used by the underlying XMLMarshaller or XMLUnmarshaller.

    • Constructor Summary

      Constructors 
      Constructor Description
      JAXBErrorHandler​(ValidationEventHandler validationEventHandler)
      Create a new JAXBErrorHandler with the specified ValidationEventHandler
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void error​(org.xml.sax.SAXParseException exception)
      Handle errors.
      void fatalError​(org.xml.sax.SAXParseException exception)
      Handle fatal errors.
      ValidationEventHandler getValidationEventHandler()
      Return the ValidationEventHandler associated with this JAXBErrorHandler.
      void warning​(org.xml.sax.SAXParseException exception)
      Handle warnings The exception will be given to the ValidationEventHandler at to attempt to handle.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JAXBErrorHandler

        public JAXBErrorHandler​(ValidationEventHandler validationEventHandler)
        Create a new JAXBErrorHandler with the specified ValidationEventHandler
        Parameters:
        validationEventHandler -
    • Method Detail

      • warning

        public void warning​(org.xml.sax.SAXParseException exception)
                     throws org.xml.sax.SAXException
        Handle warnings The exception will be given to the ValidationEventHandler at to attempt to handle.
        Specified by:
        warning in interface org.xml.sax.ErrorHandler
        Parameters:
        exception - the SAXParseException that occurred
        Throws:
        org.xml.sax.SAXException
      • error

        public void error​(org.xml.sax.SAXParseException exception)
                   throws org.xml.sax.SAXException
        Handle errors. The exception will be given to the ValidationEventHandler at to attempt to handle.
        Specified by:
        error in interface org.xml.sax.ErrorHandler
        Parameters:
        exception - the SAXParseException that occurred
        Throws:
        org.xml.sax.SAXException
      • fatalError

        public void fatalError​(org.xml.sax.SAXParseException exception)
                        throws org.xml.sax.SAXException
        Handle fatal errors. The exception will be given to the ValidationEventHandler at to attempt to handle.
        Specified by:
        fatalError in interface org.xml.sax.ErrorHandler
        Parameters:
        exception - the SAXParseException that occurred
        Throws:
        org.xml.sax.SAXException
      • getValidationEventHandler

        public ValidationEventHandler getValidationEventHandler()
        Return the ValidationEventHandler associated with this JAXBErrorHandler.
        Returns:
        the ValidationEventHandler associated with this JAXBErrorHandler.