BeanIO 2.0.4

org.beanio
Class BeanReaderErrorHandlerSupport

java.lang.Object
  extended by org.beanio.BeanReaderErrorHandlerSupport
All Implemented Interfaces:
BeanReaderErrorHandler

public class BeanReaderErrorHandlerSupport
extends 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
Author:
Kevin Seim

Constructor Summary
BeanReaderErrorHandlerSupport()
          Constructs a new BeanReaderErrorHandlerSupport.
 
Method Summary
 void fatalError(BeanReaderException ex)
          Handles errors not handled by any other method.
 void handleError(BeanReaderException ex)
          Delegates error handling based on the exception type.
 void invalidRecord(InvalidRecordException ex)
          Handles InvalidRecordException and InvalidRecordGroupException errors.
 void malformedRecord(MalformedRecordException ex)
          Handles MalformedRecordException errors.
 void unexpectedRecord(UnexpectedRecordException ex)
          Handles UnexpectedRecordException errors.
 void unidentifiedRecord(UnidentifiedRecordException ex)
          Handles UnidentifiedRecordException errors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanReaderErrorHandlerSupport

public BeanReaderErrorHandlerSupport()
Constructs a new BeanReaderErrorHandlerSupport.

Method Detail

handleError

public final void handleError(BeanReaderException ex)
                       throws Exception
Delegates error handling based on the exception type.

Specified by:
handleError in interface BeanReaderErrorHandler
Parameters:
ex - the BeanReaderException to handle
Throws:
Exception - if the BeanReaderException is rethrown or this error handler throws a new Exception

invalidRecord

public void invalidRecord(InvalidRecordException ex)
                   throws Exception
Handles InvalidRecordException and InvalidRecordGroupException errors. By default, this method simply rethrows the exception.

Parameters:
ex - the InvalidRecordException to handle
Throws:
Exception - if the exception is not handled

unexpectedRecord

public void unexpectedRecord(UnexpectedRecordException ex)
                      throws Exception
Handles UnexpectedRecordException errors. By default, this method simply rethrows the exception.

Parameters:
ex - the UnexpectedRecordException to handle
Throws:
Exception - if the exception is not handled

unidentifiedRecord

public void unidentifiedRecord(UnidentifiedRecordException ex)
                        throws Exception
Handles UnidentifiedRecordException errors. By default, this method simply rethrows the exception.

Parameters:
ex - the UnidentifiedRecordException to handle
Throws:
Exception - if the exception is not handled

malformedRecord

public void malformedRecord(MalformedRecordException ex)
                     throws Exception
Handles MalformedRecordException errors. By default, this method simply rethrows the exception.

Parameters:
ex - the MalformedRecordException to handle
Throws:
Exception - if the exception is not handled

fatalError

public void fatalError(BeanReaderException ex)
                throws Exception
Handles errors not handled by any other method. By default, this method simply rethrows the exception.

Parameters:
ex - the BeanReaderException to handle
Throws:
Exception - if the exception is not handled

BeanIO 2.0.4

Copyright © 2010-2013 Kevin Seim