INT-878 Added an error if the "type" attribute is specified on a header that has a fixed type (e.g. "expiration-date").

This commit is contained in:
Mark Fisher
2009-11-25 19:37:47 +00:00
parent 641675bbe4
commit 554779bfa8

View File

@@ -89,6 +89,11 @@ public abstract class HeaderEnricherParserSupport extends AbstractTransformerPar
else {
headerName = elementToNameMap.get(elementName);
headerType = elementToTypeMap.get(elementName);
if (headerType != null && StringUtils.hasText(headerElement.getAttribute("type"))) {
parserContext.getReaderContext().error("The " + elementName
+ " header does not accept a 'type' attribute. The required type is ["
+ headerType.getName() + "]", element);
}
}
if (headerType == null) {
String headerTypeName = headerElement.getAttribute("type");