Class TileErrorHandler
java.lang.Object
org.apache.sis.internal.coverage.j2d.TileErrorHandler
A convenience class for reporting an error during computation of a tile.
- Since:
- 1.1
- Version:
- 1.1
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAn object executing actions in a way where errors occurring during tile computation are reported to an error handler instead of causing the whole operation to fail. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final ErrorHandlerWhere to report exceptions, orErrorHandler.THROWfor throwing them.private final Class<?>The class to declare inLogRecordin an error occurred during calculation.private final StringName of the method to declare inLogRecordin an error occurred during calculation.static final TileErrorHandlerExceptions are wrapped in anImagingOpExceptionand thrown. -
Constructor Summary
ConstructorsConstructorDescriptionTileErrorHandler(ErrorHandler handler, Class<?> sourceClass, String sourceMethod) Creates a new tile error handler. -
Method Summary
Modifier and TypeMethodDescription(package private) final booleanisThrow()Returnstrueif the error handler isErrorHandler.THROW.voidpublish(ErrorHandler.Report report) If the given report is non-empty, sends it to the error handler.
-
Field Details
-
THROW
Exceptions are wrapped in anImagingOpExceptionand thrown. In such case, no result is available. This is the default handler. -
handler
Where to report exceptions, orErrorHandler.THROWfor throwing them. -
sourceClass
The class to declare inLogRecordin an error occurred during calculation. If non-null, thensourceMethodshould also be non-null. -
sourceMethod
Name of the method to declare inLogRecordin an error occurred during calculation. If non-null, thensourceClassshould also be non-null.
-
-
Constructor Details
-
TileErrorHandler
Creates a new tile error handler.- Parameters:
handler- where to report exceptions, orErrorHandler.THROWfor throwing them.sourceClass- the class to declare inLogRecordin an error occurred during calculation.sourceMethod- name of the method to declare inLogRecordin an error occurred during calculation.
-
-
Method Details
-
isThrow
final boolean isThrow()Returnstrueif the error handler isErrorHandler.THROW. In such case there is not need to configure theLogRecordsince nothing will be logged. -
publish
If the given report is non-empty, sends it to the error handler. This method sets the logger, source class and source method name on theLogRecordinstance before to publish it.- Parameters:
report- the error report to send if non-empty.
-