Package org.openscience.cdk.io
Class DefaultChemObjectReaderErrorHandler
- java.lang.Object
-
- org.openscience.cdk.io.DefaultChemObjectReaderErrorHandler
-
- All Implemented Interfaces:
IChemObjectReaderErrorHandler
public class DefaultChemObjectReaderErrorHandler extends Object implements IChemObjectReaderErrorHandler
Default implementation of theIChemObjectReaderErrorHandler
interface. Emits log entries using theLoggingToolFactory
.- Author:
- Uli Fechner
- Source code:
- main
- Belongs to CDK module:
- io
-
-
Constructor Summary
Constructors Constructor Description DefaultChemObjectReaderErrorHandler()
Constructs a new instance using theDefaultChemObjectReaderErrorHandler
class as the source for logging purposes.DefaultChemObjectReaderErrorHandler(Class<?> clazz)
Constructs a new instance using a given class as the source for logging purposes.DefaultChemObjectReaderErrorHandler(ILoggingTool logger)
Constructs a new instance using the provided logging tool.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
handleError(String message)
Method that should react on an error message send by anIChemObjectReader
.void
handleError(String message, int row, int colStart, int colEnd)
Method that should react on an error message send by anIChemObjectReader
.void
handleError(String message, int row, int colStart, int colEnd, Exception exception)
Method that should react on an error message send by anIChemObjectReader
.void
handleError(String message, Exception exception)
Method that should react on an error message send by anIChemObjectReader
.void
handleFatalError(String message)
Method that should react on a fatal error message send by anIChemObjectReader
.void
handleFatalError(String message, int row, int colStart, int colEnd)
Method that should react on a fatal error message send by anIChemObjectReader
.void
handleFatalError(String message, int row, int colStart, int colEnd, Exception exception)
Method that should react on a fatal error message send by anIChemObjectReader
.void
handleFatalError(String message, Exception exception)
Method that should react on a fatal error message send by anIChemObjectReader
.
-
-
-
Constructor Detail
-
DefaultChemObjectReaderErrorHandler
public DefaultChemObjectReaderErrorHandler()
Constructs a new instance using theDefaultChemObjectReaderErrorHandler
class as the source for logging purposes.
-
DefaultChemObjectReaderErrorHandler
public DefaultChemObjectReaderErrorHandler(Class<?> clazz)
Constructs a new instance using a given class as the source for logging purposes.- Parameters:
clazz
- the class for which theILoggingTool
should be constructed
-
DefaultChemObjectReaderErrorHandler
public DefaultChemObjectReaderErrorHandler(ILoggingTool logger)
Constructs a new instance using the provided logging tool.- Parameters:
logger
- the logger to be used for emitting log entries
-
-
Method Detail
-
handleError
public void handleError(String message)
Description copied from interface:IChemObjectReaderErrorHandler
Method that should react on an error message send by anIChemObjectReader
.- Specified by:
handleError
in interfaceIChemObjectReaderErrorHandler
- Parameters:
message
- Error found while reading.
-
handleError
public void handleError(String message, Exception exception)
Description copied from interface:IChemObjectReaderErrorHandler
Method that should react on an error message send by anIChemObjectReader
.- Specified by:
handleError
in interfaceIChemObjectReaderErrorHandler
- Parameters:
message
- Error found while reading.exception
- Exception thrown while reading.
-
handleError
public void handleError(String message, int row, int colStart, int colEnd)
Description copied from interface:IChemObjectReaderErrorHandler
Method that should react on an error message send by anIChemObjectReader
.- Specified by:
handleError
in interfaceIChemObjectReaderErrorHandler
- Parameters:
message
- Error found while reading.row
- Row in the file where the error is found.colStart
- Start column in the file where the error is found.colEnd
- End column in the file where the error is found.
-
handleError
public void handleError(String message, int row, int colStart, int colEnd, Exception exception)
Description copied from interface:IChemObjectReaderErrorHandler
Method that should react on an error message send by anIChemObjectReader
.- Specified by:
handleError
in interfaceIChemObjectReaderErrorHandler
- Parameters:
message
- Error found while reading.colStart
- Start column in the file where the error is found.colEnd
- End column in the file where the error is found.exception
- Exception thrown while reading.
-
handleFatalError
public void handleFatalError(String message)
Description copied from interface:IChemObjectReaderErrorHandler
Method that should react on a fatal error message send by anIChemObjectReader
. This error is fatal, and the state of reading is no longer defined.- Specified by:
handleFatalError
in interfaceIChemObjectReaderErrorHandler
- Parameters:
message
- Error found while reading.
-
handleFatalError
public void handleFatalError(String message, Exception exception)
Description copied from interface:IChemObjectReaderErrorHandler
Method that should react on a fatal error message send by anIChemObjectReader
. This error is fatal, and the state of reading is no longer defined.- Specified by:
handleFatalError
in interfaceIChemObjectReaderErrorHandler
- Parameters:
message
- Error found while reading.exception
- Exception thrown while reading.
-
handleFatalError
public void handleFatalError(String message, int row, int colStart, int colEnd)
Description copied from interface:IChemObjectReaderErrorHandler
Method that should react on a fatal error message send by anIChemObjectReader
. This error is fatal, and the state of reading is no longer defined.- Specified by:
handleFatalError
in interfaceIChemObjectReaderErrorHandler
- Parameters:
message
- Error found while reading.row
- Row in the file where the fatal error is found.colStart
- Start column in the file where the fatal error is found.colEnd
- End column in the file where the fatal error is found.
-
handleFatalError
public void handleFatalError(String message, int row, int colStart, int colEnd, Exception exception)
Description copied from interface:IChemObjectReaderErrorHandler
Method that should react on a fatal error message send by anIChemObjectReader
. This error is fatal, and the state of reading is no longer defined.- Specified by:
handleFatalError
in interfaceIChemObjectReaderErrorHandler
- Parameters:
message
- Error found while reading.colStart
- Start column in the file where the fatal error is found.colEnd
- End column in the file where the fatal error is found.exception
- Exception thrown while reading.
-
-