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 interface
An 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 ErrorHandler
Where to report exceptions, orErrorHandler.THROW
for throwing them.private final Class
<?> The class to declare inLogRecord
in an error occurred during calculation.private final String
Name of the method to declare inLogRecord
in an error occurred during calculation.static final TileErrorHandler
Exceptions are wrapped in anImagingOpException
and thrown. -
Constructor Summary
ConstructorsConstructorDescriptionTileErrorHandler
(ErrorHandler handler, Class<?> sourceClass, String sourceMethod) Creates a new tile error handler. -
Method Summary
Modifier and TypeMethodDescription(package private) final boolean
isThrow()
Returnstrue
if the error handler isErrorHandler.THROW
.void
publish
(ErrorHandler.Report report) If the given report is non-empty, sends it to the error handler.
-
Field Details
-
THROW
Exceptions are wrapped in anImagingOpException
and thrown. In such case, no result is available. This is the default handler. -
handler
Where to report exceptions, orErrorHandler.THROW
for throwing them. -
sourceClass
The class to declare inLogRecord
in an error occurred during calculation. If non-null, thensourceMethod
should also be non-null. -
sourceMethod
Name of the method to declare inLogRecord
in an error occurred during calculation. If non-null, thensourceClass
should also be non-null.
-
-
Constructor Details
-
TileErrorHandler
Creates a new tile error handler.- Parameters:
handler
- where to report exceptions, orErrorHandler.THROW
for throwing them.sourceClass
- the class to declare inLogRecord
in an error occurred during calculation.sourceMethod
- name of the method to declare inLogRecord
in an error occurred during calculation.
-
-
Method Details
-
isThrow
final boolean isThrow()Returnstrue
if the error handler isErrorHandler.THROW
. In such case there is not need to configure theLogRecord
since 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 theLogRecord
instance before to publish it.- Parameters:
report
- the error report to send if non-empty.
-