Interface ErrorHandler

All Known Implementing Classes:
ErrorHandlerBase

public interface ErrorHandler
An Error handler captures the policy for dealing with warnings, errors and fatal errors. Fatal errors mean termination of processing and must throw an exception. Errors and warnings may throw an exception to terminate processing or may return after, for example, logging a message. The exact policy is determined the error handler itself.

IRI parsing does not throw errors except for bad syntax. Scheme specific issues are "violations" carried by the IRI3986 object and accessed with IRI3986.forEachViolation(java.util.function.Consumer<org.apache.jena.rfc3986.Violation>).

Use with SystemIRI3986.toHandler.

  • Method Summary

    Modifier and Type
    Method
    Description
    create(Consumer<String> onError, Consumer<String> onWarning)
    Create an error handler with two functions, one for warning, one for error.
    void
    error(String message)
    Report an error : should not return.
    void
    warning(String message)
    Report a warning.
  • Method Details

    • create

      static ErrorHandler create(Consumer<String> onError, Consumer<String> onWarning)
      Create an error handler with two functions, one for warning, one for error. A value of null implies using a "no action" function.
    • warning

      void warning(String message)
      Report a warning. This method may return.
    • error

      void error(String message)
      Report an error : should not return.