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 forBeanReaderErrorHandler
implementations. ThehandleError
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 Summary
Constructors Constructor Description BeanReaderErrorHandlerSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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)
HandlesInvalidRecordException
andInvalidRecordGroupException
errors.void
malformedRecord(MalformedRecordException ex)
HandlesMalformedRecordException
errors.void
unexpectedRecord(UnexpectedRecordException ex)
HandlesUnexpectedRecordException
errors.void
unidentifiedRecord(UnidentifiedRecordException ex)
HandlesUnidentifiedRecordException
errors.
-
-
-
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 interfaceBeanReaderErrorHandler
- Parameters:
ex
- theBeanReaderException
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
HandlesInvalidRecordException
andInvalidRecordGroupException
errors. By default, this method simply rethrows the exception.- Parameters:
ex
- theInvalidRecordException
to handle- Throws:
java.lang.Exception
- if the exception is not handled
-
unexpectedRecord
public void unexpectedRecord(UnexpectedRecordException ex) throws java.lang.Exception
HandlesUnexpectedRecordException
errors. By default, this method simply rethrows the exception.- Parameters:
ex
- theUnexpectedRecordException
to handle- Throws:
java.lang.Exception
- if the exception is not handled
-
unidentifiedRecord
public void unidentifiedRecord(UnidentifiedRecordException ex) throws java.lang.Exception
HandlesUnidentifiedRecordException
errors. By default, this method simply rethrows the exception.- Parameters:
ex
- theUnidentifiedRecordException
to handle- Throws:
java.lang.Exception
- if the exception is not handled
-
malformedRecord
public void malformedRecord(MalformedRecordException ex) throws java.lang.Exception
HandlesMalformedRecordException
errors. By default, this method simply rethrows the exception.- Parameters:
ex
- theMalformedRecordException
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
- theBeanReaderException
to handle- Throws:
java.lang.Exception
- if the exception is not handled
-
-