|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.beans.factory.xml.NamespaceHandlerSupport
public abstract class NamespaceHandlerSupport
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)
, registerBeanDefinitionDecorator(java.lang.String, org.springframework.beans.factory.xml.BeanDefinitionDecorator)
methods
for registering a BeanDefinitionParser
or BeanDefinitionDecorator
to handle
a specific element.
registerBeanDefinitionParser(String, BeanDefinitionParser)
,
registerBeanDefinitionDecorator(String, BeanDefinitionDecorator)
Constructor Summary | |
---|---|
NamespaceHandlerSupport()
|
Method Summary | |
---|---|
BeanDefinitionHolder |
decorate(Node node,
BeanDefinitionHolder definition,
ParserContext parserContext)
Decorates the supplied Node by delegating to the BeanDefinitionDecorator that
is registered to handle that Node . |
protected BeanDefinitionDecorator |
findDecoratorForNode(Node node)
Locates the BeanDefinitionParser from the register implementations using
the local name of the supplied Node . |
protected BeanDefinitionParser |
findParserForElement(Element element)
Locates the BeanDefinitionParser from the register implementations using
the local name of the supplied Element . |
BeanDefinition |
parse(Element element,
ParserContext parserContext)
Parses the supplied Element by delegating to the BeanDefinitionParser that is
registered for that Element . |
protected void |
registerBeanDefinitionDecorator(String elementName,
BeanDefinitionDecorator decorator)
Subclasses can call this to register the supplied BeanDefinitionDecorator to
handle the specified element. |
protected void |
registerBeanDefinitionDecoratorForAttribute(String attributeName,
BeanDefinitionDecorator decorator)
Subclasses can call this to register the supplied BeanDefinitionDecorator to
handle the specified attribute. |
protected void |
registerBeanDefinitionParser(String elementName,
BeanDefinitionParser parser)
Subclasses can call this to register the supplied BeanDefinitionParser to
handle the specified element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.springframework.beans.factory.xml.NamespaceHandler |
---|
init |
Constructor Detail |
---|
public NamespaceHandlerSupport()
Method Detail |
---|
public final BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definition, ParserContext parserContext)
Node
by delegating to the BeanDefinitionDecorator
that
is registered to handle that Node
.
decorate
in interface NamespaceHandler
public final BeanDefinition parse(Element element, ParserContext parserContext)
Element
by delegating to the BeanDefinitionParser
that is
registered for that Element
.
parse
in interface NamespaceHandler
BeanDefinition
protected final BeanDefinitionParser findParserForElement(Element element)
BeanDefinitionParser
from the register implementations using
the local name of the supplied Element
.
protected final BeanDefinitionDecorator findDecoratorForNode(Node node)
BeanDefinitionParser
from the register implementations using
the local name of the supplied Node
. Supports both Elements
and Attrs
.
protected final void registerBeanDefinitionParser(String elementName, BeanDefinitionParser parser)
BeanDefinitionParser
to
handle the specified element. The element name is the local (non-namespace qualified)
name.
protected final void registerBeanDefinitionDecorator(String elementName, BeanDefinitionDecorator decorator)
BeanDefinitionDecorator
to
handle the specified element. The element name is the local (non-namespace qualified)
name.
protected final void registerBeanDefinitionDecoratorForAttribute(String attributeName, BeanDefinitionDecorator decorator)
BeanDefinitionDecorator
to
handle the specified attribute. The attribute name is the local (non-namespace qualified)
name.
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |