Code example for AbstractSingleBeanDefinitionParser

0
 * @author Michael Minella 
 * @author Glenn Renfro 
 * @author Chris Schaefer 
 * @since 3.0 
 */ 
public class StepParser extends AbstractSingleBeanDefinitionParser {
	private static final String CHUNK_ELEMENT = "chunk";
	private static final String BATCHLET_ELEMENT = "batchlet";
	private static final String ALLOW_START_IF_COMPLETE_ATTRIBUTE = "allow-start-if-complete";
	private static final String START_LIMIT_ATTRIBUTE = "start-limit";
	private static final String SPLIT_ID_ATTRIBUTE = "id";
	private static final String PARTITION_ELEMENT = "partition";
 
	protected Collection<BeanDefinition> parse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
		BeanDefinitionBuilder defBuilder = BeanDefinitionBuilder.genericBeanDefinition();
		AbstractBeanDefinition bd = defBuilder.getRawBeanDefinition();
		bd.setBeanClass(StepFactoryBean.class);
		bd.getPropertyValues().addPropertyValue("batchPropertyContext", new RuntimeBeanReference("batchPropertyContext"));
 
		BeanDefinitionBuilder stateBuilder = BeanDefinitionBuilder.genericBeanDefinition(JsrStepState.class);