From a35a1805b632a0b073fcadfc6c86f395f38d7821 Mon Sep 17 00:00:00 2001 From: dsyer Date: Wed, 4 Nov 2009 13:34:42 +0000 Subject: [PATCH] RESOLVED - issue BATCH-1300: Add description element to and --- .../configuration/xml/AbstractStepParser.java | 5 ++ .../core/configuration/xml/JobParser.java | 5 ++ .../configuration/xml/spring-batch-2.1.xsd | 85 ++++++++++++------- ...obExecutionListenerParserTests-context.xml | 5 +- 4 files changed, 67 insertions(+), 33 deletions(-) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractStepParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractStepParser.java index 49d1c5625..573e5d9bb 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractStepParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractStepParser.java @@ -101,6 +101,11 @@ public abstract class AbstractStepParser { if (StringUtils.hasText(jobFactoryRef)) { bd.setAttribute("jobParserJobFactoryBeanRef", jobFactoryRef); } + + Element description = DomUtils.getChildElementByTagName(stepElement, "description"); + if (description!=null) { + bd.setDescription(description.getTextContent()); + } return bd; diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobParser.java index 54602b3ea..565a62376 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobParser.java @@ -101,6 +101,11 @@ public class JobParser extends AbstractSingleBeanDefinitionParser { builder.addPropertyValue("flow", flowDef); } + Element description = DomUtils.getChildElementByTagName(element, "description"); + if (description!=null) { + builder.getBeanDefinition().setDescription(description.getTextContent()); + } + List listenersElements = DomUtils.getChildElementsByTagName(element, "listeners"); if (listenersElements.size() == 1) { Element listenersElement = listenersElements.get(0); diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/configuration/xml/spring-batch-2.1.xsd b/spring-batch-core/src/main/resources/org/springframework/batch/core/configuration/xml/spring-batch-2.1.xsd index 552d373d5..de722f3b1 100644 --- a/spring-batch-core/src/main/resources/org/springframework/batch/core/configuration/xml/spring-batch-2.1.xsd +++ b/spring-batch-core/src/main/resources/org/springframework/batch/core/configuration/xml/spring-batch-2.1.xsd @@ -26,23 +26,26 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + @@ -82,17 +85,20 @@ - - - - - - - - - - - + + + + + + + + + + + + + + @@ -231,10 +237,13 @@ - - - - + + + + + + + @@ -916,5 +925,17 @@ + + + + + + + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobExecutionListenerParserTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobExecutionListenerParserTests-context.xml index 98c33a5ea..fd7829bdc 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobExecutionListenerParserTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobExecutionListenerParserTests-context.xml @@ -7,7 +7,10 @@ - + A job that executes step1 + + A step that does some stuff +