Class BaseSpringNamespaceHandler

  • All Implemented Interfaces:
    NamespaceHandler

    public abstract class BaseSpringNamespaceHandler
    extends Object
    implements NamespaceHandler
    A base class for 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.
    • Constructor Detail

      • BaseSpringNamespaceHandler

        public BaseSpringNamespaceHandler()
    • Method Detail

      • parse

        public BeanDefinition parse​(Element element,
                                    ParserContext parserContext)
        Parses the supplied Element by delegating to the BeanDefinitionParser that is registered for that Element.
        Specified by:
        parse in interface NamespaceHandler
        Parameters:
        element - the element to be parsed into a bean definition
        parserContext - the context within which the bean definition is created
        Returns:
        the bean definition created from the given element
      • findParserForElement

        protected BeanDefinitionParser findParserForElement​(Element element)
        Locates the BeanDefinitionParser from the register implementations using the local name of the supplied Element.
        Parameters:
        element - the element to locate the bean definition parser for
        Returns:
        the parser for the given bean element
      • registerBeanDefinitionParser

        protected void registerBeanDefinitionParser​(QName elementNameOrType,
                                                    BeanDefinitionParser parser)
        Subclasses can call this to register the supplied BeanDefinitionParser to handle the specified element. The element name is the local (non-namespace qualified) name.
        Parameters:
        elementNameOrType - the element name or schema type the parser is for
        parser - the parser to register