1 24 package org.riotfamily.common.beans.xml; 25 26 import org.springframework.beans.factory.xml.BeanDefinitionDecorator; 27 import org.springframework.beans.factory.xml.BeanDefinitionParser; 28 import org.springframework.beans.factory.xml.NamespaceHandlerSupport; 29 30 34 public abstract class GenericNamespaceHandlerSupport extends NamespaceHandlerSupport { 35 36 39 protected void registerSpringBeanDefinitionParser(String elementName) { 40 registerBeanDefinitionParser(elementName, new SpringBeanDefinitionParser()); 41 } 42 43 47 protected void registerSpringBeanDefinitionParser(String elementName, 48 BeanDefinitionDecorator decorator) { 49 50 registerSpringBeanDefinitionParser(elementName); 51 registerBeanDefinitionDecorator(elementName, decorator); 52 } 53 54 58 protected GenericBeanDefinitionParser register(String elementName, Class beanClass) { 59 GenericBeanDefinitionParser parser = new GenericBeanDefinitionParser(beanClass); 60 registerBeanDefinitionParser(elementName, parser); 61 return parser; 62 } 63 64 70 protected GenericBeanDefinitionParser register(String elementName, 71 Class beanClass, BeanDefinitionDecorator decorator) { 72 73 registerBeanDefinitionDecorator(elementName, decorator); 74 return register(elementName, beanClass); 75 } 76 77 80 protected void register(String elementName, BeanDefinitionParser parser, 81 BeanDefinitionDecorator decorator) { 82 83 registerBeanDefinitionParser(elementName, parser); 84 registerBeanDefinitionDecorator(elementName, decorator); 85 } 86 } 87 | Popular Tags |