Code example for AbstractSingleBeanDefinitionParser

0
/** 
 * @author Ryan Heaton 
 * @author Andrew McCall 
 * @author Dave Syer 
 */ 
public class ConsumerServiceBeanDefinitionParser extends AbstractSingleBeanDefinitionParser {
 
	@Override 
	protected Class<?> getBeanClass(Element element) {
		return InMemoryConsumerDetailsService.class; 
	} 
 
	@Override 
	protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
		List<Element> consumerElements = DomUtils.getChildElementsByTagName(element, "consumer");
		ManagedMap<String, BeanMetadataElement> consumers = new ManagedMap<String, BeanMetadataElement>();
		for (Object item : consumerElements) {
 
			BeanDefinitionBuilder consumer = BeanDefinitionBuilder
					.genericBeanDefinition(ConsumerDetailsFactoryBean.class);