BATCH-1073: added check for <listeners> element on <step ref=/>
This commit is contained in:
@@ -60,6 +60,9 @@ public class InlineStepParser extends AbstractStepParser {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Element> listOfTaskElements = (List<Element>) DomUtils.getChildElementsByTagName(element, "tasklet");
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Element> listOfListenersElements = (List<Element>) 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);
|
||||
|
||||
Reference in New Issue
Block a user