Class BeanDefinitionParserUtils


  • public abstract class BeanDefinitionParserUtils
    extends Object
    Provides shared utility methods for bean definition parsing.
    Author:
    Christoph Deppisch
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addConstructorArgReference​(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, String beanReference)
      Sets the property reference on bean definition in case reference is set properly.
      static org.springframework.beans.factory.config.BeanDefinitionHolder registerBean​(String beanId, Class<?> beanClass, org.springframework.beans.factory.xml.ParserContext parserContext, boolean shouldFireEvents)
      Creates new bean definition from bean class and registers new bean in parser registry.
      static org.springframework.beans.factory.config.BeanDefinitionHolder registerBean​(String beanId, org.springframework.beans.factory.config.BeanDefinition beanDefinition, org.springframework.beans.factory.xml.ParserContext parserContext, boolean shouldFireEvents)
      Registers bean definition in parser registry and returns bean definition holder.
      static void setConstructorArgValue​(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, String propertyValue)
      Sets the property value on bean definition as constructor argument in case value is not null.
      static void setPropertyReference​(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, String beanReference, String propertyName)
      Sets the property reference on bean definition in case reference is set properly.
      static void setPropertyReference​(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, String beanReference, String propertyName, String defaultValue)
      Sets the property reference on bean definition.
      static void setPropertyValue​(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, String propertyValue, String propertyName)
      Sets the property value on bean definition in case value is set properly.
    • Method Detail

      • setPropertyValue

        public static void setPropertyValue​(org.springframework.beans.factory.support.BeanDefinitionBuilder builder,
                                            String propertyValue,
                                            String propertyName)
        Sets the property value on bean definition in case value is set properly.
        Parameters:
        builder - the bean definition builder to be configured
        propertyValue - the property value
        propertyName - the name of the property
      • setConstructorArgValue

        public static void setConstructorArgValue​(org.springframework.beans.factory.support.BeanDefinitionBuilder builder,
                                                  String propertyValue)
        Sets the property value on bean definition as constructor argument in case value is not null.
        Parameters:
        builder - the bean definition to be configured
        propertyValue - the property value
      • setPropertyReference

        public static void setPropertyReference​(org.springframework.beans.factory.support.BeanDefinitionBuilder builder,
                                                String beanReference,
                                                String propertyName)
        Sets the property reference on bean definition in case reference is set properly.
        Parameters:
        builder - the bean definition builder to be configured
        beanReference - bean reference to populate the property
        propertyName - the name of the property
      • addConstructorArgReference

        public static void addConstructorArgReference​(org.springframework.beans.factory.support.BeanDefinitionBuilder builder,
                                                      String beanReference)
        Sets the property reference on bean definition in case reference is set properly.
        Parameters:
        builder - the bean definition builder to be configured
        beanReference - bean reference to add as constructor arg
      • setPropertyReference

        public static void setPropertyReference​(org.springframework.beans.factory.support.BeanDefinitionBuilder builder,
                                                String beanReference,
                                                String propertyName,
                                                String defaultValue)
        Sets the property reference on bean definition. In case reference is not available a default value is set.
        Parameters:
        builder -
        beanReference -
        propertyName -
        defaultValue -
      • registerBean

        public static org.springframework.beans.factory.config.BeanDefinitionHolder registerBean​(String beanId,
                                                                                                 Class<?> beanClass,
                                                                                                 org.springframework.beans.factory.xml.ParserContext parserContext,
                                                                                                 boolean shouldFireEvents)
        Creates new bean definition from bean class and registers new bean in parser registry. Returns bean definition holder.
        Parameters:
        beanId -
        beanClass -
        parserContext -
        shouldFireEvents -
      • registerBean

        public static org.springframework.beans.factory.config.BeanDefinitionHolder registerBean​(String beanId,
                                                                                                 org.springframework.beans.factory.config.BeanDefinition beanDefinition,
                                                                                                 org.springframework.beans.factory.xml.ParserContext parserContext,
                                                                                                 boolean shouldFireEvents)
        Registers bean definition in parser registry and returns bean definition holder.
        Parameters:
        beanId -
        beanDefinition -
        parserContext -
        shouldFireEvents -
        Returns: