Package ca.uhn.hl7v2.validation
Class AbstractValidationExceptionHandler<R>
java.lang.Object
ca.uhn.hl7v2.HapiContextSupport
ca.uhn.hl7v2.validation.AbstractValidationExceptionHandler<R>
- All Implemented Interfaces:
ValidationExceptionHandler<R>
- Direct Known Subclasses:
CollectingValidationExceptionHandler,DefaultValidationExceptionHandler
public abstract class AbstractValidationExceptionHandler<R>
extends HapiContextSupport
implements ValidationExceptionHandler<R>
Abstract base class of a ValidationExceptionHandler that supports a validation subject. Concrete
implementations should inherit from this class.
- Author:
- Christian Ohr
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiderror(ValidationException exception) Called on ValidationExceptions with error severityvoidinfo(ValidationException exception) Called on ValidationExceptions with info severityvoidonExceptions(ValidationException... exceptions) Called in case of validation rule violations.voidsetValidationSubject(Object subject) Sets the object that is the target of validation.voidwarning(ValidationException exception) Called on ValidationExceptions with warning severityMethods 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
hasFailed, result
-
Constructor Details
-
AbstractValidationExceptionHandler
- Parameters:
context- Hapi Context
-
-
Method Details
-
onExceptions
Description copied from interface:ValidationExceptionHandlerCalled in case of validation rule violations.- Specified by:
onExceptionsin interfaceValidationExceptionHandler<R>- Parameters:
exceptions- the exceptions that describe the validatin errors
-
error
Called on ValidationExceptions with error severity- Parameters:
exception- ValidationException
-
warning
Called on ValidationExceptions with warning severity- Parameters:
exception- ValidationException
-
info
Called on ValidationExceptions with info severity- Parameters:
exception- ValidationException
-
setValidationSubject
Sets the object that is the target of validation. This is helpful to be called to give this handler e.g. access to the original message that has been validated.- Specified by:
setValidationSubjectin interfaceValidationExceptionHandler<R>- Parameters:
subject- subject to be validated
-
getValidationSubject
- Returns:
- the validation subject
-