Package ca.uhn.hl7v2.validation
Class DefaultValidationExceptionHandler
java.lang.Object
ca.uhn.hl7v2.HapiContextSupport
ca.uhn.hl7v2.validation.AbstractValidationExceptionHandler<Boolean>
ca.uhn.hl7v2.validation.DefaultValidationExceptionHandler
- All Implemented Interfaces:
ValidationExceptionHandler<Boolean>,ValidationExceptionHandlerFactory<Boolean>
public class DefaultValidationExceptionHandler
extends AbstractValidationExceptionHandler<Boolean>
implements ValidationExceptionHandlerFactory<Boolean>
Simple implementation of a handler that just tracks if
error(ValidationException) has been called at least once.- Author:
- Christian Ohr
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionvoiderror(ValidationException exception) If the validation process encounters a violation, this method is called.getNewInstance(HapiContext theContext) booleanReturns a boolean flag indicating whether a validation was successful or not.result()Called after the validation process.Methods inherited from class ca.uhn.hl7v2.validation.AbstractValidationExceptionHandler
getValidationSubject, info, onExceptions, setValidationSubject, warningMethods inherited from class ca.uhn.hl7v2.HapiContextSupport
getHapiContext, setHapiContext
-
Constructor Details
-
DefaultValidationExceptionHandler
public DefaultValidationExceptionHandler() -
DefaultValidationExceptionHandler
-
-
Method Details
-
error
If the validation process encounters a violation, this method is called.- Overrides:
errorin classAbstractValidationExceptionHandler<Boolean>- Parameters:
exception- aValidationExceptionof error severity.
-
result
Called after the validation process. Should return an overall boolean validation result.- Specified by:
resultin interfaceValidationExceptionHandler<Boolean>- Returns:
- the overall assessment of the validation process. This method should usually return
falseifAbstractValidationExceptionHandler.onExceptions(ValidationException[])has been called at least once.
-
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.- Specified by:
hasFailedin interfaceValidationExceptionHandler<Boolean>- Returns:
- true if the validation is considered to be failed.
-
getNewInstance
- Specified by:
getNewInstancein interfaceValidationExceptionHandlerFactory<Boolean>- Parameters:
theContext- HAPI context- Returns:
- a new instance of a ValidationExceptionHandler
-