Class CollectingValidationEventHandler

java.lang.Object
com.helger.jaxb.validation.AbstractValidationEventHandler
com.helger.jaxb.validation.CollectingValidationEventHandler
All Implemented Interfaces:
IValidationEventHandler, jakarta.xml.bind.ValidationEventHandler

@ThreadSafe public class CollectingValidationEventHandler extends AbstractValidationEventHandler
An implementation of the JAXB ValidationEventHandler interface. It collects all events that occurred!
Author:
Philip Helger
  • Field Details

    • m_aRWLock

      protected final com.helger.commons.concurrent.SimpleReadWriteLock m_aRWLock
  • Constructor Details

    • CollectingValidationEventHandler

      public CollectingValidationEventHandler()
  • Method Details

    • onEvent

      protected void onEvent(@Nonnull com.helger.commons.error.IError aEvent)
      Description copied from class: AbstractValidationEventHandler
      Callback method invoked when an error occurs.
      Specified by:
      onEvent in class AbstractValidationEventHandler
      Parameters:
      aEvent - The occurred error.
    • getErrorList

      @Nonnull @ReturnsMutableCopy public com.helger.commons.error.list.IErrorList getErrorList()
    • forEachResourceError

      public void forEachResourceError(@Nonnull Consumer<? super com.helger.commons.error.IError> aConsumer)
      Call the provided consumer for all contained resource errors.
      Parameters:
      aConsumer - The consumer to be invoked. May not be null. May only perform reading actions!
    • clearResourceErrors

      @Nonnull public com.helger.commons.state.EChange clearResourceErrors()
      Clear all currently stored errors.
      Returns:
      EChange.CHANGED if at least one item was cleared.
    • toString

      public String toString()
      Overrides:
      toString in class AbstractValidationEventHandler