Package org.beanio

Class BeanReaderErrorHandlerSupport

  • All Implemented Interfaces:
    BeanReaderErrorHandler

    public class BeanReaderErrorHandlerSupport
    extends java.lang.Object
    implements BeanReaderErrorHandler
    Provides support for BeanReaderErrorHandler implementations. The handleError method delegates to other methods that can be overridden to handle specific error types. If a method is not overridden for a specific error type, the method will simply rethrow the exception by default.
    Since:
    1.0
    • Constructor Detail

      • BeanReaderErrorHandlerSupport

        public BeanReaderErrorHandlerSupport()
    • Method Detail

      • handleError

        public final void handleError​(BeanReaderException ex)
                               throws java.lang.Exception
        Delegates error handling based on the exception type.
        Specified by:
        handleError in interface BeanReaderErrorHandler
        Parameters:
        ex - the BeanReaderException to handle
        Throws:
        java.lang.Exception - if the BeanReaderException is rethrown or this error handler throws a new Exception
      • invalidRecord

        public void invalidRecord​(InvalidRecordException ex)
                           throws java.lang.Exception
        Handles InvalidRecordException and InvalidRecordGroupException errors. By default, this method simply rethrows the exception.
        Parameters:
        ex - the InvalidRecordException to handle
        Throws:
        java.lang.Exception - if the exception is not handled
      • unexpectedRecord

        public void unexpectedRecord​(UnexpectedRecordException ex)
                              throws java.lang.Exception
        Handles UnexpectedRecordException errors. By default, this method simply rethrows the exception.
        Parameters:
        ex - the UnexpectedRecordException to handle
        Throws:
        java.lang.Exception - if the exception is not handled
      • unidentifiedRecord

        public void unidentifiedRecord​(UnidentifiedRecordException ex)
                                throws java.lang.Exception
        Handles UnidentifiedRecordException errors. By default, this method simply rethrows the exception.
        Parameters:
        ex - the UnidentifiedRecordException to handle
        Throws:
        java.lang.Exception - if the exception is not handled
      • malformedRecord

        public void malformedRecord​(MalformedRecordException ex)
                             throws java.lang.Exception
        Handles MalformedRecordException errors. By default, this method simply rethrows the exception.
        Parameters:
        ex - the MalformedRecordException to handle
        Throws:
        java.lang.Exception - if the exception is not handled
      • fatalError

        public void fatalError​(BeanReaderException ex)
                        throws java.lang.Exception
        Handles errors not handled by any other method. By default, this method simply rethrows the exception.
        Parameters:
        ex - the BeanReaderException to handle
        Throws:
        java.lang.Exception - if the exception is not handled