edu.internet2.middleware.shibboleth.common.config
Class BaseSpringNamespaceHandler

java.lang.Object
  extended by edu.internet2.middleware.shibboleth.common.config.BaseSpringNamespaceHandler
All Implemented Interfaces:
org.springframework.beans.factory.xml.NamespaceHandler
Direct Known Subclasses:
AttributeAuthorityNamespaceHandler, AttributeDefinitionNamespaceHandler, AttributeEncoderNamespaceHandler, AttributeFilterNamespaceHandler, AttributeResolverNamespaceHandler, BasicMatchFunctorNamespaceHandler, DataConnectorNamespaceHandler, MetadataNamespaceHandler, PrincipalConnectorNamespaceHandler, RelyingPartyNamespaceHandler, ResourceNamespaceHandler, SAMLMatchFunctorNamespaceHandler, SAMLRelyingPartyNamespaceHandler, SAMLSecurityNamespaceHandler, SecurityNamespaceHandler, ServiceNamespaceHandler

public abstract class BaseSpringNamespaceHandler
extends Object
implements org.springframework.beans.factory.xml.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 Summary
BaseSpringNamespaceHandler()
           
 
Method Summary
 org.springframework.beans.factory.config.BeanDefinitionHolder decorate(Node node, org.springframework.beans.factory.config.BeanDefinitionHolder definition, org.springframework.beans.factory.xml.ParserContext parserContext)
          Decorates the supplied Node by delegating to the BeanDefinitionDecorator that is registered to handle that Node.
protected  org.springframework.beans.factory.xml.BeanDefinitionDecorator findDecoratorForNode(Node node)
          Locates the BeanDefinitionParser from the register implementations using the local name of the supplied Node.
protected  org.springframework.beans.factory.xml.BeanDefinitionParser findParserForElement(Element element)
          Locates the BeanDefinitionParser from the register implementations using the local name of the supplied Element.
 org.springframework.beans.factory.config.BeanDefinition parse(Element element, org.springframework.beans.factory.xml.ParserContext parserContext)
          Parses the supplied Element by delegating to the BeanDefinitionParser that is registered for that Element.
protected  void registerBeanDefinitionDecorator(QName elementNameOrType, org.springframework.beans.factory.xml.BeanDefinitionDecorator decorator)
          Subclasses can call this to register the supplied BeanDefinitionDecorator to handle the specified element.
protected  void registerBeanDefinitionDecoratorForAttribute(QName attributeName, org.springframework.beans.factory.xml.BeanDefinitionDecorator decorator)
          Subclasses can call this to register the supplied BeanDefinitionDecorator to handle the specified attribute.
protected  void registerBeanDefinitionParser(QName elementNameOrType, org.springframework.beans.factory.xml.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

BaseSpringNamespaceHandler

public BaseSpringNamespaceHandler()
Method Detail

decorate

public org.springframework.beans.factory.config.BeanDefinitionHolder decorate(Node node,
                                                                              org.springframework.beans.factory.config.BeanDefinitionHolder definition,
                                                                              org.springframework.beans.factory.xml.ParserContext parserContext)
Decorates the supplied Node by delegating to the BeanDefinitionDecorator that is registered to handle that Node.

Specified by:
decorate in interface org.springframework.beans.factory.xml.NamespaceHandler
Parameters:
node - the node decorating a the given bean definition
definition - the bean being decorated
parserContext - the current parser context
Returns:
the deocrated bean definition

parse

public org.springframework.beans.factory.config.BeanDefinition parse(Element element,
                                                                     org.springframework.beans.factory.xml.ParserContext parserContext)
Parses the supplied Element by delegating to the BeanDefinitionParser that is registered for that Element.

Specified by:
parse in interface org.springframework.beans.factory.xml.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 org.springframework.beans.factory.xml.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

findDecoratorForNode

protected org.springframework.beans.factory.xml.BeanDefinitionDecorator findDecoratorForNode(Node node)
Locates the BeanDefinitionParser from the register implementations using the local name of the supplied Node. Supports both Elements and Attrs.

Parameters:
node - the node to locate the decorator for
Returns:
the decorator for the given node

registerBeanDefinitionParser

protected void registerBeanDefinitionParser(QName elementNameOrType,
                                            org.springframework.beans.factory.xml.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

registerBeanDefinitionDecorator

protected void registerBeanDefinitionDecorator(QName elementNameOrType,
                                               org.springframework.beans.factory.xml.BeanDefinitionDecorator decorator)
Subclasses can call this to register the supplied BeanDefinitionDecorator 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
decorator - the decorator to register

registerBeanDefinitionDecoratorForAttribute

protected void registerBeanDefinitionDecoratorForAttribute(QName attributeName,
                                                           org.springframework.beans.factory.xml.BeanDefinitionDecorator decorator)
Subclasses can call this to register the supplied BeanDefinitionDecorator to handle the specified attribute. The attribute name is the local (non-namespace qualified) name.

Parameters:
attributeName - the name of the attribute to register the decorator for
decorator - the decorator to register


Copyright © 2006-2008 Internet2. All Rights Reserved.