Interface InvalidityHandler

All Known Implementing Classes:
InvalidityHandlerWrappingErrorListener, InvalidityHandlerWrappingErrorReporter, InvalidityReportGenerator, InvalidityReportGeneratorEE, StandardInvalidityHandler, ValidatorImpl.InvalidityHandlerWrappingErrorHandler

public interface InvalidityHandler
Interface for reporting validation errors found during validation of an instance document against a schema.
  • Method Summary

    Modifier and Type
    Method
    Description
    At the end of a validation episode, do any closedown actions, and optionally return information collected in the course of validation (for example a list of error messages).
    void
    Report a validation error found during validation of an instance document against a schema
    void
    At the start of a validation episode, initialize the handler
  • Method Details

    • startReporting

      void startReporting(String systemId) throws XPathException
      At the start of a validation episode, initialize the handler
      Parameters:
      systemId - This will typically be the systemId property of the Source object representing the instance document being validated. In cases where the validation applies to something other than a Source object (for example, in-situ validation of a DOM tree, or XSLT-invoked validation of a result document), or where the Source object has no SystemId property, then it may either be null, or may be some other URI associated with the document.
      Throws:
      XPathException - if initialization of the invalidity handler fails for any reason
    • reportInvalidity

      void reportInvalidity(Invalidity failure) throws XPathException
      Report a validation error found during validation of an instance document against a schema
      Parameters:
      failure - details of the validation error
      Throws:
      XPathException - - if the validation error cannot be reported. This is fatal and will cause the validation run to be abandoned
    • endReporting

      Sequence endReporting() throws XPathException
      At the end of a validation episode, do any closedown actions, and optionally return information collected in the course of validation (for example a list of error messages).
      Returns:
      a value to be associated with a validation exception. May be the empty sequence. In the case of the InvalidityReportGenerator, this returns the XML document containing the validation report. This will be the value returned as the value of the variable $err:value during try/catch processing
      Throws:
      XPathException - if an error occurs creating any validation report