类 NamespaceHandlerSupport
- java.lang.Object
- org.springframework.beans.factory.xml.NamespaceHandlerSupport
- 所有已实现的接口:
NamespaceHandler
- 直接已知子类:
AopNamespaceHandler
,CacheNamespaceHandler
,ContextNamespaceHandler
,JdbcNamespaceHandler
,JeeNamespaceHandler
,JmsNamespaceHandler
,LangNamespaceHandler
,MvcNamespaceHandler
,OxmNamespaceHandler
,TaskNamespaceHandler
,TxNamespaceHandler
,UtilNamespaceHandler
,WebSocketNamespaceHandler
public abstract class NamespaceHandlerSupport extends Object implements NamespaceHandler
Support class for implementing customNamespaceHandlers
. Parsing and decorating of individualNodes
is done viaBeanDefinitionParser
andBeanDefinitionDecorator
strategy interfaces, respectively.Provides the
registerBeanDefinitionParser(java.lang.String, org.springframework.beans.factory.xml.BeanDefinitionParser)
andregisterBeanDefinitionDecorator(java.lang.String, org.springframework.beans.factory.xml.BeanDefinitionDecorator)
methods for registering aBeanDefinitionParser
orBeanDefinitionDecorator
to handle a specific element.- 从以下版本开始:
- 2.0
- 作者:
- Rob Harrop, Juergen Hoeller
- 另请参阅:
registerBeanDefinitionParser(String, BeanDefinitionParser)
,registerBeanDefinitionDecorator(String, BeanDefinitionDecorator)
构造器概要
构造器 构造器 说明 NamespaceHandlerSupport()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 BeanDefinitionHolder
decorate(Node node, BeanDefinitionHolder definition, ParserContext parserContext)
Decorates the suppliedNode
by delegating to theBeanDefinitionDecorator
that is registered to handle thatNode
.BeanDefinition
parse(Element element, ParserContext parserContext)
Parses the suppliedElement
by delegating to theBeanDefinitionParser
that is registered for thatElement
.protected void
registerBeanDefinitionDecorator(String elementName, BeanDefinitionDecorator dec)
Subclasses can call this to register the suppliedBeanDefinitionDecorator
to handle the specified element.protected void
registerBeanDefinitionDecoratorForAttribute(String attrName, BeanDefinitionDecorator dec)
Subclasses can call this to register the suppliedBeanDefinitionDecorator
to handle the specified attribute.protected void
registerBeanDefinitionParser(String elementName, BeanDefinitionParser parser)
Subclasses can call this to register the suppliedBeanDefinitionParser
to handle the specified element.从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 org.springframework.beans.factory.xml.NamespaceHandler
init
构造器详细资料
NamespaceHandlerSupport
public NamespaceHandlerSupport()
方法详细资料
parse
public BeanDefinition parse(Element element, ParserContext parserContext)
Parses the suppliedElement
by delegating to theBeanDefinitionParser
that is registered for thatElement
.- 指定者:
parse
在接口中NamespaceHandler
- 参数:
element
- the element that is to be parsed into one or moreBeanDefinitions
parserContext
- the object encapsulating the current state of the parsing process- 返回:
- the primary
BeanDefinition
(can benull
as explained above)
decorate
public BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definition, ParserContext parserContext)
Decorates the suppliedNode
by delegating to theBeanDefinitionDecorator
that is registered to handle thatNode
.- 指定者:
decorate
在接口中NamespaceHandler
- 参数:
node
- the source element or attribute that is to be parseddefinition
- the current bean definitionparserContext
- the object encapsulating the current state of the parsing process- 返回:
- the decorated definition (to be registered in the BeanFactory), or simply the original bean definition if no decoration is required. A
null
value is strictly speaking invalid, but will be leniently treated like the case where the original bean definition gets returned.
registerBeanDefinitionParser
protected final void registerBeanDefinitionParser(String elementName, BeanDefinitionParser parser)
Subclasses can call this to register the suppliedBeanDefinitionParser
to handle the specified element. The element name is the local (non-namespace qualified) name.
registerBeanDefinitionDecorator
protected final void registerBeanDefinitionDecorator(String elementName, BeanDefinitionDecorator dec)
Subclasses can call this to register the suppliedBeanDefinitionDecorator
to handle the specified element. The element name is the local (non-namespace qualified) name.
registerBeanDefinitionDecoratorForAttribute
protected final void registerBeanDefinitionDecoratorForAttribute(String attrName, BeanDefinitionDecorator dec)
Subclasses can call this to register the suppliedBeanDefinitionDecorator
to handle the specified attribute. The attribute name is the local (non-namespace qualified) name.