Package ca.uhn.hl7v2.validation
Class CollectingValidationExceptionHandler<R>
java.lang.Object
ca.uhn.hl7v2.HapiContextSupport
ca.uhn.hl7v2.validation.AbstractValidationExceptionHandler<R>
ca.uhn.hl7v2.validation.CollectingValidationExceptionHandler<R>
- All Implemented Interfaces:
ValidationExceptionHandler<R>
- Direct Known Subclasses:
RespondingValidationExceptionHandler,SimpleValidationExceptionHandler
public abstract class CollectingValidationExceptionHandler<R>
extends AbstractValidationExceptionHandler<R>
ValidationExceptionHandler that collects all
ValidationExceptions in a list.
Subclasses can then derive a overall result from this list.- Author:
- Christian Ohr
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiderror(ValidationException exception) Called on ValidationExceptions with error severitybooleanReturns a boolean flag indicating whether a validation was successful or not.voidinfo(ValidationException exception) Called on ValidationExceptions with info severityvoidsetMinimumSeverityToCollect(Severity minimumSeverityToCollect) Set the minimum severity to be added to the list of exceptions.voidwarning(ValidationException exception) Called on ValidationExceptions with warning severityMethods inherited from class ca.uhn.hl7v2.validation.AbstractValidationExceptionHandler
getValidationSubject, onExceptions, setValidationSubjectMethods inherited from class ca.uhn.hl7v2.HapiContextSupport
getHapiContext, setHapiContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ca.uhn.hl7v2.validation.ValidationExceptionHandler
result
-
Constructor Details
-
CollectingValidationExceptionHandler
- Parameters:
context- Hapi context
-
-
Method Details
-
error
Description copied from class:AbstractValidationExceptionHandlerCalled on ValidationExceptions with error severity- Overrides:
errorin classAbstractValidationExceptionHandler<R>- Parameters:
exception- ValidationException
-
info
Description copied from class:AbstractValidationExceptionHandlerCalled on ValidationExceptions with info severity- Overrides:
infoin classAbstractValidationExceptionHandler<R>- Parameters:
exception- ValidationException
-
warning
Description copied from class:AbstractValidationExceptionHandlerCalled on ValidationExceptions with warning severity- Overrides:
warningin classAbstractValidationExceptionHandler<R>- Parameters:
exception- ValidationException
-
getExceptions
- Returns:
- unmodifiable list of collected exceptions. If none have occurred, the list is empty.
-
setMinimumSeverityToCollect
Set the minimum severity to be added to the list of exceptions. Default is ERROR.- Parameters:
minimumSeverityToCollect- the minimum severity to be added to the list of exceptions
-
getMinimumSeverityToCollect
- Returns:
- the minimum severity to be added to the list of exceptions. Default is ERROR.
-
hasFailed
Description copied from interface:ValidationExceptionHandlerReturns a boolean flag indicating whether a validation was successful or not. This is independent ofValidationExceptionHandler.result()which may return a more complex object.- Returns:
- true if the validation is considered to be failed.
- See Also:
-