BATCH-1004: improved error handling and documentation for step element

This commit is contained in:
trisberg
2009-01-27 04:21:31 +00:00
parent e68d9a246a
commit 2898861782
2 changed files with 11 additions and 4 deletions

View File

@@ -67,6 +67,10 @@ public class StepParser {
String stepRef = element.getAttribute("name");
String taskletRef = element.getAttribute("tasklet");
if (!StringUtils.hasText(stepRef)) {
parserContext.getReaderContext().error("The name attribute can't be empty for <" + element.getNodeName() + ">", element);
}
@SuppressWarnings("unchecked")
List<Element> processTaskElements = (List<Element>) DomUtils.getChildElementsByTagName(element, "tasklet");
if (StringUtils.hasText(taskletRef)) {

View File

@@ -117,9 +117,11 @@
<xsd:annotation>
<xsd:documentation>
Defines a stage in job processing backed by a
Step. The name
attribute has to match the id of a bean definition
for a Step.
Step.
The name attribute must be specified and
can match the id of a bean definition
for a Step. If it does not, then you must provide a
tasklet definition.
The next attribute is a synonym for &lt;next on="*" .../&gt;
</xsd:documentation>
</xsd:annotation>
@@ -129,7 +131,8 @@
<xsd:attribute name="name" type="xsd:string" use="required" >
<xsd:annotation>
<xsd:documentation>
The step name is a reference to another bean definition where business logic is specified.
The step name attribute defines the name for the step. It can be used as
a reference to another bean definition where business logic is specified.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>