Spring Social

org.springframework.social.config.xml
Class AbstractProviderConfigNamespaceHandler

java.lang.Object
  extended by org.springframework.social.config.xml.AbstractProviderConfigNamespaceHandler
All Implemented Interfaces:
org.springframework.beans.factory.xml.NamespaceHandler

public abstract class AbstractProviderConfigNamespaceHandler
extends java.lang.Object
implements org.springframework.beans.factory.xml.NamespaceHandler

Base NamespaceHandler for Spring Social provider modules to create configuration namespaces. Requires, at minimum, that the provider-specific namespace provider an AbstractProviderConfigBeanDefinition for parsing "config" elements.

Author:
Craig Walls

Constructor Summary
AbstractProviderConfigNamespaceHandler()
           
 
Method Summary
 org.springframework.beans.factory.config.BeanDefinitionHolder decorate(org.w3c.dom.Node node, org.springframework.beans.factory.config.BeanDefinitionHolder beanDefinitionHolder, org.springframework.beans.factory.xml.ParserContext parserContext)
           
protected abstract  AbstractProviderConfigBeanDefinitionParser getProviderConfigBeanDefinitionParser()
          Implemented by provider namespaces to provide an instance of the bean definition parser that will parse the "config" element.
 void init()
           
protected  void loadParsers(java.util.Map<java.lang.String,org.springframework.beans.factory.xml.BeanDefinitionParser> parsers)
          Hook method to allow provider-specific implementation to register bean definition parsers for their namespace.
 org.springframework.beans.factory.config.BeanDefinition parse(org.w3c.dom.Element element, org.springframework.beans.factory.xml.ParserContext parserContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractProviderConfigNamespaceHandler

public AbstractProviderConfigNamespaceHandler()
Method Detail

init

public final void init()
Specified by:
init in interface org.springframework.beans.factory.xml.NamespaceHandler

parse

public final org.springframework.beans.factory.config.BeanDefinition parse(org.w3c.dom.Element element,
                                                                           org.springframework.beans.factory.xml.ParserContext parserContext)
Specified by:
parse in interface org.springframework.beans.factory.xml.NamespaceHandler

decorate

public org.springframework.beans.factory.config.BeanDefinitionHolder decorate(org.w3c.dom.Node node,
                                                                              org.springframework.beans.factory.config.BeanDefinitionHolder beanDefinitionHolder,
                                                                              org.springframework.beans.factory.xml.ParserContext parserContext)
Specified by:
decorate in interface org.springframework.beans.factory.xml.NamespaceHandler

getProviderConfigBeanDefinitionParser

protected abstract AbstractProviderConfigBeanDefinitionParser getProviderConfigBeanDefinitionParser()
Implemented by provider namespaces to provide an instance of the bean definition parser that will parse the "config" element. This is the only configuration element required by a provider namespace. If a provider namespace offers additional elements, then their bean definition parsers may be registered by overriding the loadParsers() method.

Returns:
an instance of AbstractProviderConfigBeanDefinitionParser to register against the "config" element in the namespace.

loadParsers

protected void loadParsers(java.util.Map<java.lang.String,org.springframework.beans.factory.xml.BeanDefinitionParser> parsers)
Hook method to allow provider-specific implementation to register bean definition parsers for their namespace. An overriding method will simply add one or more bean definition parsers to the given map where the key is the name of the element the parser handles. Overriding this method is optional and there is no need to override it just to add the provider-specific implementation of AbstractProviderConfigBeanDefinitionParser. That bean definition parser will always be registered, whether or not this method is overridden.

Parameters:
parsers - a Map of parsers to be applied when parsing the namespace.

Spring Social