public abstract class BaseSpringNamespaceHandler extends Object implements org.springframework.beans.factory.xml.NamespaceHandler
NamespaceHandler implementations.
This code is heavily based on Spring's NamespaceHandlerSupport. The largest difference is that bean
definition parsers may be registered against either an elements name or schema type. During parser lookup the schema
type is preferred.| Modifier and Type | Field and Description |
|---|---|
private Map<QName,org.springframework.beans.factory.xml.BeanDefinitionDecorator> |
attributeDecorators
Deprecated.
|
private Map<QName,org.springframework.beans.factory.xml.BeanDefinitionDecorator> |
decorators
Deprecated.
|
private org.slf4j.Logger |
log
Class logger.
|
private Map<QName,org.springframework.beans.factory.xml.BeanDefinitionParser> |
parsers
Stores the
BeanDefinitionParser implementations keyed by the local name of the Elements
they handle. |
| Constructor and Description |
|---|
BaseSpringNamespaceHandler() |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.beans.factory.config.BeanDefinitionHolder |
decorate(Node node,
org.springframework.beans.factory.config.BeanDefinitionHolder definition,
org.springframework.beans.factory.xml.ParserContext parserContext)
|
protected org.springframework.beans.factory.xml.BeanDefinitionDecorator |
findDecoratorForNode(Node node)
Locates the
BeanDefinitionParser from the register implementations using the local name of the supplied
Node. |
protected org.springframework.beans.factory.xml.BeanDefinitionParser |
findParserForElement(Element element)
Locates the
BeanDefinitionParser from the register implementations using the local name of the supplied
Element. |
org.springframework.beans.factory.config.BeanDefinition |
parse(Element element,
org.springframework.beans.factory.xml.ParserContext parserContext)
|
protected void |
registerBeanDefinitionDecorator(QName elementNameOrType,
org.springframework.beans.factory.xml.BeanDefinitionDecorator decorator)
Deprecated.
- the parsers should be cast to not need decorations or another base class used
|
protected void |
registerBeanDefinitionDecoratorForAttribute(QName attributeName,
org.springframework.beans.factory.xml.BeanDefinitionDecorator decorator)
Deprecated.
- the parsers should be cast to not need decorations or another base class used
|
protected void |
registerBeanDefinitionParser(QName elementNameOrType,
org.springframework.beans.factory.xml.BeanDefinitionParser parser)
Subclasses can call this to register the supplied
BeanDefinitionParser to handle the specified element. |
private final org.slf4j.Logger log
private Map<QName,org.springframework.beans.factory.xml.BeanDefinitionParser> parsers
BeanDefinitionParser implementations keyed by the local name of the Elements
they handle.@Deprecated private Map<QName,org.springframework.beans.factory.xml.BeanDefinitionDecorator> decorators
BeanDefinitionDecorator implementations keyed by the local name of the Elements they handle.@Deprecated private Map<QName,org.springframework.beans.factory.xml.BeanDefinitionDecorator> attributeDecorators
BeanDefinitionParser implementations keyed by the local name of the Attrs they
handle.public org.springframework.beans.factory.config.BeanDefinitionHolder decorate(Node node, org.springframework.beans.factory.config.BeanDefinitionHolder definition, org.springframework.beans.factory.xml.ParserContext parserContext)
Node by delegating to the BeanDefinitionDecorator that is registered to
handle that Node.decorate in interface org.springframework.beans.factory.xml.NamespaceHandlernode - the node decorating a the given bean definitiondefinition - the bean being decoratedparserContext - the current parser contextpublic org.springframework.beans.factory.config.BeanDefinition parse(Element element, org.springframework.beans.factory.xml.ParserContext parserContext)
Element by delegating to the BeanDefinitionParser that is registered for that
Element.parse in interface org.springframework.beans.factory.xml.NamespaceHandlerelement - the element to be parsed into a bean definitionparserContext - the context within which the bean definition is createdprotected org.springframework.beans.factory.xml.BeanDefinitionParser findParserForElement(Element element)
BeanDefinitionParser from the register implementations using the local name of the supplied
Element.element - the element to locate the bean definition parser forprotected org.springframework.beans.factory.xml.BeanDefinitionDecorator findDecoratorForNode(Node node)
BeanDefinitionParser from the register implementations using the local name of the supplied
Node. Supports both Elements and Attrs.node - the node to locate the decorator forprotected void registerBeanDefinitionParser(QName elementNameOrType, org.springframework.beans.factory.xml.BeanDefinitionParser parser)
BeanDefinitionParser to handle the specified element.
The element name is the local (non-namespace qualified) name.elementNameOrType - the element name or schema type the parser is forparser - the parser to register@Deprecated protected void registerBeanDefinitionDecorator(QName elementNameOrType, org.springframework.beans.factory.xml.BeanDefinitionDecorator decorator)
BeanDefinitionDecorator to handle the specified
element. The element name is the local (non-namespace qualified) name.elementNameOrType - the element name or schema type the parser is fordecorator - the decorator to register@Deprecated protected void registerBeanDefinitionDecoratorForAttribute(QName attributeName, org.springframework.beans.factory.xml.BeanDefinitionDecorator decorator)
BeanDefinitionDecorator to handle the specified
attribute. The attribute name is the local (non-namespace qualified) name.attributeName - the name of the attribute to register the decorator fordecorator - the decorator to registerCopyright © 1999–2019 Shibboleth Consortium. All rights reserved.