Class BaseSpringNamespaceHandler

All Implemented Interfaces:

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.
  • Field Details

  • Constructor Details

    • BaseSpringNamespaceHandler

      public BaseSpringNamespaceHandler()
  • Method Details

    • decorate

      public BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definition, ParserContext parserContext)
      A noop decorator. Returns the input.
      Specified by:
      decorate in interface NamespaceHandler
      node - the node decorating a the given bean definition
      definition - the bean being decorated
      parserContext - the current parser context
      the input bean definition
    • 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
      element - the element to be parsed into a bean definition
      parserContext - the context within which the bean definition is created
      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.
      element - the element to locate the bean definition parser for
      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.
      elementNameOrType - the element name or schema type the parser is for
      parser - the parser to register