Class BeanDefinitionParser

java.lang.Object
org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
org.apache.camel.spring.xml.handler.BeanDefinitionParser
All Implemented Interfaces:
org.springframework.beans.factory.xml.BeanDefinitionParser
Direct Known Subclasses:
CamelNamespaceHandler.CamelContextBeanDefinitionParser, CamelNamespaceHandler.EndpointDefinitionParser, CamelNamespaceHandler.RestContextDefinitionParser, CamelNamespaceHandler.RouteConfigurationContextDefinitionParser, CamelNamespaceHandler.RouteContextDefinitionParser, CamelNamespaceHandler.RouteTemplateContextDefinitionParser, CamelNamespaceHandler.SSLContextParametersFactoryBeanBeanDefinitionParser, ErrorHandlerDefinitionParser, ErrorHandlerDefinitionParser.RedeliveryPolicyDefinitionParser

public class BeanDefinitionParser extends org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
A base class for a parser for a bean.
  • Field Summary

    Fields inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser

    ID_ATTRIBUTE, NAME_ATTRIBUTE
  • Constructor Summary

    Constructors
    Constructor
    Description
    BeanDefinitionParser(Class<?> type, boolean assignId)
    Bean definition parser
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    doParse(Element element, org.springframework.beans.factory.support.BeanDefinitionBuilder builder)
     
    protected String
    extractPropertyName(String attributeName)
    Extract a JavaBean property name from the supplied attribute name.
    protected Class<?>
     
    protected boolean
     
    protected boolean
    isEligibleAttribute(String attributeName)
     
    protected void
    postProcess(org.springframework.beans.factory.support.BeanDefinitionBuilder beanDefinition, Element element)
    Hook method that derived classes can implement to inspect/change a bean definition after parsing is complete.

    Methods inherited from class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser

    doParse, getBeanClassName, getParentName, parseInternal

    Methods inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser

    parse, postProcessComponentDefinition, registerBeanDefinition, resolveId, shouldFireEvents, shouldGenerateId, shouldGenerateIdAsFallback, shouldParseNameAsAliases

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BeanDefinitionParser

      public BeanDefinitionParser(Class<?> type, boolean assignId)
      Bean definition parser
      Parameters:
      type - the type, can be null
      assignId - whether to allow assigning id from the id attribute on the type (there must be getter/setter id on type class).
  • Method Details

    • getBeanClass

      protected Class<?> getBeanClass(Element element)
      Overrides:
      getBeanClass in class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
    • isAssignId

      protected boolean isAssignId()
    • isEligibleAttribute

      protected boolean isEligibleAttribute(String attributeName)
    • doParse

      protected void doParse(Element element, org.springframework.beans.factory.support.BeanDefinitionBuilder builder)
      Overrides:
      doParse in class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
    • extractPropertyName

      protected String extractPropertyName(String attributeName)
      Extract a JavaBean property name from the supplied attribute name.

      The default implementation uses the Conventions.attributeNameToPropertyName(String) method to perform the extraction.

      The name returned must obey the standard JavaBean property name conventions. For example for a class with a setter method 'setBingoHallFavourite(String)', the name returned had better be 'bingoHallFavourite' (with that exact casing).

      Parameters:
      attributeName - the attribute name taken straight from the XML element being parsed (never null)
      Returns:
      the extracted JavaBean property name (must never be null)
    • postProcess

      protected void postProcess(org.springframework.beans.factory.support.BeanDefinitionBuilder beanDefinition, Element element)
      Hook method that derived classes can implement to inspect/change a bean definition after parsing is complete.

      The default implementation does nothing.

      Parameters:
      beanDefinition - the parsed (and probably totally defined) bean definition being built
      element - the XML element that was the source of the bean definition's metadata