Class NamespaceHandlerSupport
java.lang.Object
org.springframework.beans.factory.xml.NamespaceHandlerSupport
- All Implemented Interfaces:
- NamespaceHandler
- Direct Known Subclasses:
- AopNamespaceHandler,- CacheNamespaceHandler,- ContextNamespaceHandler,- JdbcNamespaceHandler,- JeeNamespaceHandler,- JmsNamespaceHandler,- LangNamespaceHandler,- MvcNamespaceHandler,- OxmNamespaceHandler,- TaskNamespaceHandler,- TxNamespaceHandler,- UtilNamespaceHandler,- WebSocketNamespaceHandler
Support class for implementing custom 
NamespaceHandlers.
 Parsing and decorating of individual Nodes is done via BeanDefinitionParser
 and BeanDefinitionDecorator strategy interfaces, respectively.
 Provides the registerBeanDefinitionParser(java.lang.String, org.springframework.beans.factory.xml.BeanDefinitionParser) and registerBeanDefinitionDecorator(java.lang.String, org.springframework.beans.factory.xml.BeanDefinitionDecorator)
 methods for registering a BeanDefinitionParser or BeanDefinitionDecorator
 to handle a specific element.
- Since:
- 2.0
- Author:
- Rob Harrop, Juergen Hoeller
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiondecorate(Node node, BeanDefinitionHolder definition, ParserContext parserContext) Decorates the suppliedNodeby delegating to theBeanDefinitionDecoratorthat is registered to handle thatNode.parse(Element element, ParserContext parserContext) Parses the suppliedElementby delegating to theBeanDefinitionParserthat is registered for thatElement.protected final voidregisterBeanDefinitionDecorator(String elementName, BeanDefinitionDecorator dec) Subclasses can call this to register the suppliedBeanDefinitionDecoratorto handle the specified element.protected final voidSubclasses can call this to register the suppliedBeanDefinitionDecoratorto handle the specified attribute.protected final voidregisterBeanDefinitionParser(String elementName, BeanDefinitionParser parser) Subclasses can call this to register the suppliedBeanDefinitionParserto handle the specified element.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.xml.NamespaceHandlerinit
- 
Constructor Details- 
NamespaceHandlerSupportpublic NamespaceHandlerSupport()
 
- 
- 
Method Details- 
parseParses the suppliedElementby delegating to theBeanDefinitionParserthat is registered for thatElement.- Specified by:
- parsein interface- NamespaceHandler
- Parameters:
- element- the element that is to be parsed into one or more- BeanDefinitions
- parserContext- the object encapsulating the current state of the parsing process
- Returns:
- the primary BeanDefinition(can benullas explained above)
 
- 
decorate@Nullable public BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definition, ParserContext parserContext) Decorates the suppliedNodeby delegating to theBeanDefinitionDecoratorthat is registered to handle thatNode.- Specified by:
- decoratein interface- NamespaceHandler
- Parameters:
- node- the source element or attribute that is to be parsed
- definition- the current bean definition
- parserContext- the object encapsulating the current state of the parsing process
- Returns:
- the decorated definition (to be registered in the BeanFactory),
 or simply the original bean definition if no decoration is required.
 A nullvalue is strictly speaking invalid, but will be leniently treated like the case where the original bean definition gets returned.
 
- 
registerBeanDefinitionParserSubclasses can call this to register the suppliedBeanDefinitionParserto handle the specified element. The element name is the local (non-namespace qualified) name.
- 
registerBeanDefinitionDecoratorprotected final void registerBeanDefinitionDecorator(String elementName, BeanDefinitionDecorator dec) Subclasses can call this to register the suppliedBeanDefinitionDecoratorto handle the specified element. The element name is the local (non-namespace qualified) name.
- 
registerBeanDefinitionDecoratorForAttributeprotected final void registerBeanDefinitionDecoratorForAttribute(String attrName, BeanDefinitionDecorator dec) Subclasses can call this to register the suppliedBeanDefinitionDecoratorto handle the specified attribute. The attribute name is the local (non-namespace qualified) name.
 
-