BATCH-1139: Add requirement that standalone <tasklet/> be abstract. Otherwise users might think that they can use <step tasklet="?"/> to refer to it. They must always use <tasklet parent="?"/>.

This commit is contained in:
dhgarrette
2009-03-13 07:32:40 +00:00
parent 1204ec62fc
commit 260a49649c

View File

@@ -34,6 +34,11 @@ public class TopLevelTaskletElementParser extends AbstractBeanDefinitionParser {
@Override
protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) {
if (!Boolean.valueOf(element.getAttribute("abstract"))) {
parserContext.getReaderContext().error(
"The <tasklet/> element, when not contained with a <step/>, must be abstract", element);
}
return taskletElementParser.parse(element, parserContext);
}