/** * @return <code>true</code> if default namespace is set properly */ private boolean hasCorrectNamespace(Document domDocumentToValidate, List<ValidationException> validationErrors) { String nsUri = domDocumentToValidate.getDocumentElement().getNamespaceURI(); boolean ok = DEFAULT_NS.equals(nsUri); if (!ok) { ValidationException e = new ValidationException( "The default namespace of the XML document is incorrect - should be " + DEFAULT_NS + " but was " + nsUri); validationErrors.add(e); log.error(e.getMessage()); } return ok; }
/** * @return <code>true</code> if default namespace is set properly */ private boolean hasCorrectNamespace(Document domDocumentToValidate, List<ValidationException> validationErrors) { String nsUri = domDocumentToValidate.getDocumentElement().getNamespaceURI(); boolean ok = DEFAULT_NS.equals(nsUri); if (!ok) { ValidationException e = new ValidationException( "The default namespace of the XML document is incorrect - should be " + DEFAULT_NS + " but was " + nsUri); validationErrors.add(e); log.error(e.getMessage()); } return ok; }
/** * If the validation failed, throws Exception or returns <code>false</code>, * depending on {link {@link #throwFirstException}. * * @throws HL7Exception if validation has failed and * {@link #throwFirstException} is true * @see ca.uhn.hl7v2.validation.DefaultValidationExceptionHandler#result() */ public Boolean result() throws HL7Exception { if (hasFailed() && throwFirstException) throw new HL7Exception(firstException.getMessage(), firstException); return !hasFailed(); }
/** * If the validation failed, throws Exception or returns <code>false</code>, * depending on {link {@link #throwFirstException}. * * @throws HL7Exception if validation has failed and * {@link #throwFirstException} is true * @see ca.uhn.hl7v2.validation.DefaultValidationExceptionHandler#result() */ public Boolean result() throws HL7Exception { if (hasFailed() && throwFirstException) throw new HL7Exception(firstException.getMessage(), firstException); return !hasFailed(); }