From 14e7c6d01daa7e4c1a4a98680931dfae1ba1b908 Mon Sep 17 00:00:00 2001 From: dhgarrette Date: Wed, 11 Feb 2009 17:41:42 +0000 Subject: [PATCH] BATCH-1073: added check for element on --- .../batch/core/configuration/xml/InlineStepParser.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/InlineStepParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/InlineStepParser.java index 4d25143e4..140b01f01 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/InlineStepParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/InlineStepParser.java @@ -60,6 +60,9 @@ public class InlineStepParser extends AbstractStepParser { @SuppressWarnings("unchecked") List listOfTaskElements = (List) DomUtils.getChildElementsByTagName(element, "tasklet"); + @SuppressWarnings("unchecked") + List listOfListenersElements = (List) DomUtils.getChildElementsByTagName(element, "listeners"); + if (StringUtils.hasText(stepRef)) { if (StringUtils.hasText(taskletRef)) { parserContext.getReaderContext().error("The 'tasklet' attribute can't be combined with the 'ref=\""+ stepRef +"\"' attribute specification for <" + element.getNodeName() + ">", element); @@ -68,6 +71,9 @@ public class InlineStepParser extends AbstractStepParser { parserContext.getReaderContext().error("The <" + listOfTaskElements.get(0).getNodeName() + "> element can't be combined with the 'ref=\""+ stepRef +"\"' attribute specification for <" + element.getNodeName() + ">", element); } + if (listOfListenersElements.size() > 0) { + parserContext.getReaderContext().error("The 'listeners' element can't be combined with the 'ref=\""+ stepRef +"\"' attribute specification for <" + element.getNodeName() + ">", element); + } BeanDefinitionBuilder stepBuilder = BeanDefinitionBuilder.genericBeanDefinition("org.springframework.batch.core.configuration.xml.DelegatingStep"); stepBuilder.addConstructorArgValue(stepId);