Interface ErrorReporter

  • All Known Implementing Classes:
    ErrorReporterToListener, SchemaFactoryImpl.ErrorReporterWrappingErrorHandler, StandardErrorReporter
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    public interface ErrorReporter
    The ErrorReporter is a generic functional interface for reporting errors and warnings.

    The error or warning is reported in the form of an XmlProcessingError; unlike the JAXP ErrorListener and ErrorHandler it is possible to report errors without expensively construction an exception object.

    The ErrorReporter's accept() method does not throw any checked exceptions. It may however, throw an UncheckedXPathException indicating that processing is to be terminated without looking for further errors.

    A warning condition is notified using an XmlProcessingError object whose isWarning() property is true.

    • Method Detail

      • report

        void report​(XmlProcessingError error)
        Report an error. This method is called by Saxon when an error needs to be reported to the calling application.

        The application can safely ignore the error if XmlProcessingError.isWarning() returns true.

        The application can indicate to Saxon that the error should be considered fatal by calling XmlProcessingError.setTerminationMessage(String). The precise effect of marking an error as fatal is not defined, and may depend on the circumstances; in some cases it may have no effect. If a dynamic error is marked as fatal then an attempt to catch the error using a try/catch construct in XSLT or XQuery will generally be unsuccessful.

        error - details of the error to be reported