Package com.helger.jaxb.validation
Class AbstractValidationEventHandler
java.lang.Object
com.helger.jaxb.validation.AbstractValidationEventHandler
- All Implemented Interfaces:
IValidationEventHandler,jakarta.xml.bind.ValidationEventHandler
- Direct Known Subclasses:
CollectingValidationEventHandler,DoNothingValidationEventHandler,LoggingValidationEventHandler,WrappedCollectingValidationEventHandler
@NotThreadSafe
public abstract class AbstractValidationEventHandler
extends Object
implements IValidationEventHandler
An abstract implementation of the JAXB
ValidationEventHandler
interface.- Author:
- Philip Helger
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor not encapsulating any existing handler. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancontinueProcessing(com.helger.commons.error.level.IErrorLevel aErrorLevel) Should the processing be continued?protected StringgetErrorFieldName(jakarta.xml.bind.ValidationEventLocator aLocator) protected com.helger.commons.error.level.IErrorLevelgetErrorLevel(int nSeverity) Get the error level matching the passed JAXB severity.protected StringgetLocationResourceID(jakarta.xml.bind.ValidationEventLocator aLocator) final booleanhandleEvent(jakarta.xml.bind.ValidationEvent aEvent) protected abstract voidonEvent(com.helger.commons.error.IError aError) Callback method invoked when an error occurs.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.helger.jaxb.validation.IValidationEventHandler
andThen
-
Constructor Details
-
AbstractValidationEventHandler
protected AbstractValidationEventHandler()Constructor not encapsulating any existing handler.
-
-
Method Details
-
getErrorLevel
@Nonnull @OverrideOnDemand protected com.helger.commons.error.level.IErrorLevel getErrorLevel(int nSeverity) Get the error level matching the passed JAXB severity.- Parameters:
nSeverity- The JAXB severity.- Returns:
- The matching
IErrorLevel. Nevernull.
-
getLocationResourceID
-
getErrorFieldName
-
onEvent
Callback method invoked when an error occurs.- Parameters:
aError- The occurred error.
-
continueProcessing
@OverrideOnDemand protected boolean continueProcessing(@Nonnull com.helger.commons.error.level.IErrorLevel aErrorLevel) Should the processing be continued? By default it is always continued, as long as no fatal error occurs. This method is only invoked, if no wrapped handler is present.- Parameters:
aErrorLevel- The error level to be checked.- Returns:
trueif processing should be continued,falseif processing should stop.
-
handleEvent
- Specified by:
handleEventin interfacejakarta.xml.bind.ValidationEventHandler
-
toString
-