be.ehealth.technicalconnector.validator.impl.handler

## Class ErrorCollectorHandler

- java.lang.Object
- - be.ehealth.technicalconnector.validator.impl.handler.ErrorCollectorHandler

- All Implemented Interfaces:
    ErrorHandler

      public class ErrorCollectorHandler
      extends Object
      implements ErrorHandler

  SAX `ErrorHandler` that collects `SAXParseException`s by severity instead of throwing immediately, allowing callers to inspect all validation errors after parsing completes.

  If a `XOPValidationHandler` is supplied and detects an XOP element, errors and fatals are silently suppressed (XOP payloads are not fully inlined and will always produce schema violations).

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ERROR`
    `static String` | `FATAL`
    `static String` | `WARNING`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ErrorCollectorHandler()`
    `ErrorCollectorHandler(XOPValidationHandler xopHandler)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `error(SAXParseException ex)`
    `void` | `fatalError(SAXParseException ex)`
    `List<String>` | `getExceptionList(String... errorTypes)` Returns all collected messages for the requested severity levels.
    `boolean` | `hasExceptions(String... errorTypes)` Returns `true` if any messages were collected for the requested severity levels.
    `void` | `warning(SAXParseException ex)`

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

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

- - ### Field Detail

    - #### WARNING

          public static final String WARNING

      See Also:
        Constant Field Values

    - #### ERROR

          public static final String ERROR

      See Also:
        Constant Field Values

    - #### FATAL

          public static final String FATAL

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ErrorCollectorHandler

          public ErrorCollectorHandler()

    - #### ErrorCollectorHandler

          public ErrorCollectorHandler(XOPValidationHandler xopHandler)

  - ### Method Detail

    - #### warning

          public void warning(SAXParseException ex)

      Specified by:
        `warning` in interface `ErrorHandler`

    - #### error

          public void error(SAXParseException ex)

      Specified by:
        `error` in interface `ErrorHandler`

    - #### fatalError

          public void fatalError(SAXParseException ex)

      Specified by:
        `fatalError` in interface `ErrorHandler`

    - #### getExceptionList

          public List<String> getExceptionList(String... errorTypes)

      Returns all collected messages for the requested severity levels. Valid values are `WARNING`, `ERROR`, and `FATAL`.
      Parameters:
        `errorTypes` - one or more severity constants
      Returns:
        unmodifiable list of collected messages, in collection order

    - #### hasExceptions

          public boolean hasExceptions(String... errorTypes)

      Returns `true` if any messages were collected for the requested severity levels.
      Parameters:
        `errorTypes` - one or more severity constants

Connector Packaging PERSAUDIOLOGIST 4.9.5 API
Copyright © {inceptionYear}-2026 eHealth. All Rights Reserved.