Package ca.uhn.hl7v2.validation
Interface Validator<R>
- All Known Implementing Classes:
AbstractValidator,DefaultValidator,MessageValidator
public interface Validator<R>
Interface to validates messages.
- Author:
- Bryan Tripp, Christian Ohr
-
Method Summary
Modifier and TypeMethodDescriptionValidates aMessagevalidate(Message message, ValidationExceptionHandler<R> handler) Validates aMessageusing a customValidationExceptionHandler.Validates a String representing an encoded messagevalidate(String message, boolean isXML, String version, ValidationExceptionHandler<R> handler) Validates a String representing an encoded message.
-
Method Details
-
validate
Validates aMessage- Parameters:
message- message to be validated- Returns:
trueif message is valid- Throws:
HL7Exception- if an unexpected error occurs while validatingNullPointerException- if the message is null
-
validate
Validates a String representing an encoded message- Parameters:
message- message to be validatedisXML- true if message is supposed to be XMLversion- message version- Returns:
trueif message is valid- Throws:
HL7Exception- if an unexpected error occurs while validatingNullPointerException- if the message is null
-
validate
Validates aMessageusing a customValidationExceptionHandler. The handler provides the possibility to react on the outcome of the validation process and its individual steps, e.g. collecting all validation, issues, aggregating them to a single issue, logging, throwing exceptions etc.As the handler usually maintains state, a new instance is required for every validation call.
- Parameters:
message- message to be validatedhandler- message validation handler- Returns:
trueif message is valid- Throws:
HL7Exception- if an unexpected error occurs while validatingNullPointerException- if the message or handler isnull
-
validate
R validate(String message, boolean isXML, String version, ValidationExceptionHandler<R> handler) throws HL7Exception Validates a String representing an encoded message. As the handler usually maintains state, a new instance is required for every validation call.- Parameters:
message- message to be validatedisXML- true if message is supposed to be XMLversion- message versionhandler- message validation handler- Returns:
trueif message is valid- Throws:
HL7Exception- if an unexpected error occurs while validatingNullPointerException- if the message or handler isnull
-