List of usage examples for org.springframework.integration.xml AggregatedXmlMessageValidationException AggregatedXmlMessageValidationException
public AggregatedXmlMessageValidationException(List<Throwable> exceptions)
From source file:org.springframework.integration.xml.selector.XmlValidatingMessageSelector.java
@SuppressWarnings("unchecked") public boolean accept(Message<?> message) { SAXParseException[] validationExceptions = null; try {//from w ww . ja v a 2s. c o m validationExceptions = this.xmlValidator.validate(this.converter.convertToSource(message.getPayload())); } catch (Exception e) { throw new MessageHandlingException(message, e); } boolean validationSuccess = ObjectUtils.isEmpty(validationExceptions); if (!validationSuccess) { if (this.throwExceptionOnRejection) { throw new MessageRejectedException(message, "Message was rejected due to XML Validation errors", new AggregatedXmlMessageValidationException( CollectionUtils.arrayToList(validationExceptions))); } if (logger.isDebugEnabled()) { logger.debug("Message was rejected due to XML Validation errors"); } } return validationSuccess; }