Package com.saxonica.ee.validate

## Class InvalidityReportGeneratorEE

- java.lang.Object
- - net.sf.saxon.lib.StandardDiagnostics
  - - net.sf.saxon.lib.StandardInvalidityHandler
    - - net.sf.saxon.lib.InvalidityReportGenerator
      - - com.saxonica.ee.validate.InvalidityReportGeneratorEE

- All Implemented Interfaces:
    `InvalidityHandler`

      public class InvalidityReportGeneratorEE
      extends InvalidityReportGenerator

  This class `InvalidityReportGenerator` extends the standard error handler for errors found during validation of an instance document against a schema, used if user specifies -report option on validate. Its effect is to output the validation errors found into the filename specified in an XML format.

- - ### Field Summary

    - ### Fields inherited from class net.sf.saxon.lib.InvalidityReportGenerator

      `REPORT_NS`

    - ### Fields inherited from class net.sf.saxon.lib.StandardDiagnostics

      `MAX_MESSAGE_LENGTH, MAX_MESSAGE_LINE_LENGTH, MIN_MESSAGE_LINE_LENGTH, TARGET_MESSAGE_LINE_LENGTH`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `InvalidityReportGeneratorEE​(Configuration config)` |
    `InvalidityReportGeneratorEE​(Configuration config, Receiver receiver)` | Create a Report Invalidity Handler writing to a Receiver
    `InvalidityReportGeneratorEE​(Configuration config, Destination destination)` | Create a Report Invalidity Handler writing to a s9api Destination

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `createMetaData()` | Create metedata element which contains summary information in the output XML document
    `Sequence` | `endReporting()` | Get the value to be associated with a validation exception.
    `Destination` | `getDestination()` |
    `int` | `getErrorCount()` |
    `int` | `getWarningCount()` |
    `void` | `reportInvalidity​(Invalidity failure)` | Receive notification of a validity error.
    `void` | `setDestination​(Destination destination)` | Set the writer
    `void` | `setReceiver​(Receiver receiver)` |
    `void` | `setSchemaName​(java.lang.String name)` | Set the XSD document used to validation process
    `void` | `setSystemId​(java.lang.String id)` | Set the XML document that is to be validated
    `void` | `setXsdVersion​(java.lang.String version)` |
    `void` | `startReporting​(java.lang.String systemId)` | At the start of a validation episode, initialize the handler

    - ### Methods inherited from class net.sf.saxon.lib.InvalidityReportGenerator

      `getWriter, setReceiver`

    - ### Methods inherited from class net.sf.saxon.lib.StandardInvalidityHandler

      `getConfiguration, getConstraintReferenceMessage, getExpandedMessage, getLocationMessage, getLogger, setLogger`

    - ### Methods inherited from class net.sf.saxon.lib.StandardDiagnostics

      `abbreviateLocationURI, abbreviateLocationURIDefault, expandSpecialCharacters, formatListOfOffendingNodes, getInstructionName, getInstructionNameDefault, getLocationMessageText, printStackTrace, showOriginator, wordWrap`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### InvalidityReportGeneratorEE

          public InvalidityReportGeneratorEE​(Configuration config)

    - #### InvalidityReportGeneratorEE

          public InvalidityReportGeneratorEE​(Configuration config,
                                             Destination destination)
                                      throws SaxonApiException

      Create a Report Invalidity Handler writing to a s9api Destination
      Parameters:
        `config` - the Saxon configuration
        `destination` - required to output the validation errors
      Throws:
        `SaxonApiException`

    - #### InvalidityReportGeneratorEE

          public InvalidityReportGeneratorEE​(Configuration config,
                                             Receiver receiver)
                                      throws XPathException

      Create a Report Invalidity Handler writing to a Receiver
      Parameters:
        `config` - the Saxon configuration
        `receiver` - required to output the validation errors
      Throws:
        `XPathException`

  - ### Method Detail

    - #### setReceiver

          public void setReceiver​(Receiver receiver)

    - #### setDestination

          public void setDestination​(Destination destination)
                              throws SaxonApiException

      Set the writer
      Parameters:
        `destination` - required to output the validation errors
      Throws:
        `SaxonApiException`

    - #### setSystemId

          public void setSystemId​(java.lang.String id)

      Set the XML document that is to be validated
      Overrides:
        `setSystemId` in class `InvalidityReportGenerator`
      Parameters:
        `id` - of the source document

    - #### setSchemaName

          public void setSchemaName​(java.lang.String name)

      Set the XSD document used to validation process
      Overrides:
        `setSchemaName` in class `InvalidityReportGenerator`
      Parameters:
        `name` - of xsd file

    - #### getErrorCount

          public int getErrorCount()

      Overrides:
        `getErrorCount` in class `InvalidityReportGenerator`

    - #### getWarningCount

          public int getWarningCount()

      Overrides:
        `getWarningCount` in class `InvalidityReportGenerator`

    - #### setXsdVersion

          public void setXsdVersion​(java.lang.String version)

      Overrides:
        `setXsdVersion` in class `InvalidityReportGenerator`

    - #### reportInvalidity

          public void reportInvalidity​(Invalidity failure)
                                throws XPathException

      Receive notification of a validity error.
      Specified by:
        `reportInvalidity` in interface `InvalidityHandler`
      Overrides:
        `reportInvalidity` in class `InvalidityReportGenerator`
      Parameters:
        `failure` - Information about the nature of the invalidity
      Throws:
        `XPathException` - - if the validation error cannot be reported. This is fatal and will cause the validation run to be abandoned

    - #### getDestination

          public Destination getDestination()

    - #### startReporting

          public void startReporting​(java.lang.String systemId)
                              throws XPathException

      Description copied from class: `InvalidityReportGenerator`
      At the start of a validation episode, initialize the handler
      Specified by:
        `startReporting` in interface `InvalidityHandler`
      Overrides:
        `startReporting` in class `InvalidityReportGenerator`
      Parameters:
        `systemId` - optional; may be used to represent the destination of any report produced
      Throws:
        `XPathException` - if initialization of the invalidity handler fails for any reason

    - #### endReporting

          public Sequence endReporting()
                                throws XPathException

      Description copied from class: `StandardInvalidityHandler`
      Get the value to be associated with a validation exception. May return null. In the case of the InvalidityReportGenerator, this returns the XML document containing the validation report
      Specified by:
        `endReporting` in interface `InvalidityHandler`
      Overrides:
        `endReporting` in class `InvalidityReportGenerator`
      Returns:
        a value (or null). 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

    - #### createMetaData

          public void createMetaData()
                              throws XPathException

      Create metedata element which contains summary information in the output XML document
      Overrides:
        `createMetaData` in class `InvalidityReportGenerator`
      Throws:
        `XPathException`