/** * @see ca.uhn.hl7v2.validation.ValidationExceptionHandler#hasFailed() */ public boolean hasFailed() { for (ValidationException ve : exceptions) { if (ve.getSeverity() == Severity.ERROR) return true; } return false; }
/** * @see ca.uhn.hl7v2.validation.ValidationExceptionHandler#hasFailed() */ public boolean hasFailed() { for (ValidationException ve : exceptions) { if (ve.getSeverity() == Severity.ERROR) return true; } return false; }
/** * Logs all exceptions * * @see ca.uhn.hl7v2.validation.CollectingValidationExceptionHandler#onExceptions(ca.uhn.hl7v2.validation.ValidationException[]) */ public void onExceptions(ValidationException... exceptions) { if (firstException == null) firstException = exceptions[0]; for (ValidationException ve : exceptions) { switch (ve.getSeverity()) { case ERROR : LOG.error("Invalid message", ve); break; case WARNING: LOG.warn("Message with warnings", ve); break; case INFO: LOG.info("Message with comments", ve); break; } } }
/** * Logs all exceptions * * @see ca.uhn.hl7v2.validation.CollectingValidationExceptionHandler#onExceptions(ca.uhn.hl7v2.validation.ValidationException[]) */ public void onExceptions(ValidationException... exceptions) { if (firstException == null) firstException = exceptions[0]; for (ValidationException ve : exceptions) { switch (ve.getSeverity()) { case ERROR : LOG.error("Invalid message", ve); break; case WARNING: LOG.warn("Message with warnings", ve); break; case INFO: LOG.info("Message with comments", ve); break; } } }
/** * Populates the generated response based on the collected * {@link ValidationException}s. In case of exceptions, each exception will * cause an entry in one or more ERR segments. * * @param response response message to be populated * @throws HL7Exception */ protected void populateResponseMessage(Message response) throws HL7Exception { if (response == null) return; List<ValidationException> exceptions = getExceptions(); for (int i = 0; i < exceptions.size(); i++) { ValidationException ve = exceptions.get(i); // TODO respect minimumSeverity here? if (ve.getSeverity() == Severity.ERROR) { ve.populateResponse(response, getErrorAcknowledgementCode(), i); } } }
/** * Populates the generated response based on the collected * {@link ValidationException}s. In case of exceptions, each exception will * cause an entry in one or more ERR segments. * * @param response response message to be populated * @throws HL7Exception */ protected void populateResponseMessage(Message response) throws HL7Exception { if (response == null) return; List<ValidationException> exceptions = getExceptions(); for (int i = 0; i < exceptions.size(); i++) { ValidationException ve = exceptions.get(i); // TODO respect minimumSeverity here? if (ve.getSeverity() == Severity.ERROR) { ve.populateResponse(response, getErrorAcknowledgementCode(), i); } } }
public void onExceptions(ValidationException... exceptions) { for (ValidationException ve : exceptions) { switch (ve.getSeverity()) { case ERROR: error(ve); break; case INFO: info(ve); break; case WARNING: warning(ve); break; } } }
public void onExceptions(ValidationException... exceptions) { for (ValidationException ve : exceptions) { switch (ve.getSeverity()) { case ERROR: error(ve); break; case INFO: info(ve); break; case WARNING: warning(ve); break; } } }