|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface NamespaceHandler
Base interface used by the DefaultBeanDefinitionDocumentReader
handling custom namespaces
in a Spring XML configuration file. Implementations are expected to return implementations
of the BeanDefinitionParser
interface for custom top-level
tags and implementations of the BeanDefinitionDecorator
interface for custom nested tags.
The parser will call parse(org.w3c.dom.Element, org.springframework.beans.factory.xml.ParserContext)
when it encounters a custom tag directly
under the <beans>
tags and decorate(org.w3c.dom.Node, org.springframework.beans.factory.config.BeanDefinitionHolder, org.springframework.beans.factory.xml.ParserContext)
when it encounters
a custom tag directly under a <bean>
tag.
DefaultBeanDefinitionDocumentReader
,
NamespaceHandlerResolver
Method Summary | |
---|---|
BeanDefinitionHolder |
decorate(Node element,
BeanDefinitionHolder definition,
ParserContext parserContext)
Parse the specified Node and decorate the supplied BeanDefinition ,
returning the decorated definition. |
void |
init()
Invoked by the DefaultBeanDefinitionDocumentReader after construction but before
any custom elements are parsed. |
BeanDefinition |
parse(Element element,
ParserContext parserContext)
Parse the specified Element and register resulting BeanDefinitions
with the BeanDefinitionRegistry embedded in the supplied ParserContext . |
Method Detail |
---|
void init()
DefaultBeanDefinitionDocumentReader
after construction but before
any custom elements are parsed.
BeanDefinition parse(Element element, ParserContext parserContext)
Element
and register resulting BeanDefinitions
with the BeanDefinitionRegistry
embedded in the supplied ParserContext
.
Implementations should return the primary BeanDefinition
that results
from the parse phase if they which to be used nested inside <property>
tag.
Implementations may return null
if they will not be used in
a nested scenario.
BeanDefinition
BeanDefinitionHolder decorate(Node element, BeanDefinitionHolder definition, ParserContext parserContext)
Node
and decorate the supplied BeanDefinition
,
returning the decorated definition. The Node
may be either an Attr
or an
Element
.
Implementations may choose to return a completely new definition, which will replace
the original definition in the resulting BeanFactory
.
The supplied ParserContext
can be used to register any additional beans
needed to support the main definition.
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |