Package org.beanio
Class BeanReaderErrorHandlerSupport
- java.lang.Object
-
- org.beanio.BeanReaderErrorHandlerSupport
-
- All Implemented Interfaces:
BeanReaderErrorHandler
public class BeanReaderErrorHandlerSupport extends java.lang.Object implements BeanReaderErrorHandler
Provides support forBeanReaderErrorHandlerimplementations. ThehandleErrormethod 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 Summary
Constructors Constructor Description BeanReaderErrorHandlerSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfatalError(BeanReaderException ex)Handles errors not handled by any other method.voidhandleError(BeanReaderException ex)Delegates error handling based on the exception type.voidinvalidRecord(InvalidRecordException ex)HandlesInvalidRecordExceptionandInvalidRecordGroupExceptionerrors.voidmalformedRecord(MalformedRecordException ex)HandlesMalformedRecordExceptionerrors.voidunexpectedRecord(UnexpectedRecordException ex)HandlesUnexpectedRecordExceptionerrors.voidunidentifiedRecord(UnidentifiedRecordException ex)HandlesUnidentifiedRecordExceptionerrors.
-
-
-
Method Detail
-
handleError
public final void handleError(BeanReaderException ex) throws java.lang.Exception
Delegates error handling based on the exception type.- Specified by:
handleErrorin interfaceBeanReaderErrorHandler- Parameters:
ex- theBeanReaderExceptionto 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
HandlesInvalidRecordExceptionandInvalidRecordGroupExceptionerrors. By default, this method simply rethrows the exception.- Parameters:
ex- theInvalidRecordExceptionto handle- Throws:
java.lang.Exception- if the exception is not handled
-
unexpectedRecord
public void unexpectedRecord(UnexpectedRecordException ex) throws java.lang.Exception
HandlesUnexpectedRecordExceptionerrors. By default, this method simply rethrows the exception.- Parameters:
ex- theUnexpectedRecordExceptionto handle- Throws:
java.lang.Exception- if the exception is not handled
-
unidentifiedRecord
public void unidentifiedRecord(UnidentifiedRecordException ex) throws java.lang.Exception
HandlesUnidentifiedRecordExceptionerrors. By default, this method simply rethrows the exception.- Parameters:
ex- theUnidentifiedRecordExceptionto handle- Throws:
java.lang.Exception- if the exception is not handled
-
malformedRecord
public void malformedRecord(MalformedRecordException ex) throws java.lang.Exception
HandlesMalformedRecordExceptionerrors. By default, this method simply rethrows the exception.- Parameters:
ex- theMalformedRecordExceptionto 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- theBeanReaderExceptionto handle- Throws:
java.lang.Exception- if the exception is not handled
-
-