Class TileErrorHandler

java.lang.Object
org.apache.sis.internal.coverage.j2d.TileErrorHandler

public final class TileErrorHandler extends Object
A convenience class for reporting an error during computation of a tile.
Since:
1.1
Version:
1.1
  • Field Details

    • THROW

      public static final TileErrorHandler THROW
      Exceptions are wrapped in an ImagingOpException and thrown. In such case, no result is available. This is the default handler.
    • handler

      final ErrorHandler handler
      Where to report exceptions, or ErrorHandler.THROW for throwing them.
    • sourceClass

      private final Class<?> sourceClass
      The class to declare in LogRecord in an error occurred during calculation. If non-null, then sourceMethod should also be non-null.
    • sourceMethod

      private final String sourceMethod
      Name of the method to declare in LogRecord in an error occurred during calculation. If non-null, then sourceClass should also be non-null.
  • Constructor Details

    • TileErrorHandler

      public TileErrorHandler(ErrorHandler handler, Class<?> sourceClass, String sourceMethod)
      Creates a new tile error handler.
      Parameters:
      handler - where to report exceptions, or ErrorHandler.THROW for throwing them.
      sourceClass - the class to declare in LogRecord in an error occurred during calculation.
      sourceMethod - name of the method to declare in LogRecord in an error occurred during calculation.
  • Method Details

    • isThrow

      final boolean isThrow()
      Returns true if the error handler is ErrorHandler.THROW. In such case there is not need to configure the LogRecord since nothing will be logged.
    • publish

      public void publish(ErrorHandler.Report report)
      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 the LogRecord instance before to publish it.
      Parameters:
      report - the error report to send if non-empty.