Class ParsingUtils

java.lang.Object
org.springframework.data.config.ParsingUtils

public abstract class ParsingUtils extends Object
Utility methods for BeanDefinitionParser implementations.
Author:
Oliver Gierke, Mark Paluch
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.springframework.beans.factory.support.AbstractBeanDefinition
    getObjectFactoryBeanDefinition(String targetBeanName, Object source)
    Returns a BeanDefinition for an ObjectFactoryCreatingFactoryBean pointing to the bean with the given name.
    static org.springframework.beans.factory.support.AbstractBeanDefinition
    getSourceBeanDefinition(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, Object source)
    Returns the AbstractBeanDefinition built by the given builder with the given extracted source applied.
    static org.springframework.beans.factory.support.AbstractBeanDefinition
    getSourceBeanDefinition(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, org.springframework.beans.factory.xml.ParserContext context, Element element)
    Returns the BeanDefinition built by the given BeanDefinitionBuilder enriched with source information derived from the given Element.
    static void
    setPropertyReference(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, Element element, String attribute, String property)
    Configures a bean property reference with the value of the attribute of the given name if it is configured.
    static void
    setPropertyValue(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, Element element, String attribute)
    Sets the property with the given attribute name on the given BeanDefinitionBuilder to the value of the attribute with the given name if the attribute is configured.
    static void
    setPropertyValue(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, Element element, String attrName, String propertyName)
    Configures a property value for the given property name reading the attribute of the given name from the given Element if the attribute is configured.

    Methods inherited from class java.lang.Object

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

    • setPropertyValue

      public static void setPropertyValue(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, Element element, String attrName, String propertyName)
      Configures a property value for the given property name reading the attribute of the given name from the given Element if the attribute is configured.
      Parameters:
      builder - must not be null.
      element - must not be null.
      attrName - must not be null or empty.
      propertyName - must not be null or empty.
    • setPropertyValue

      public static void setPropertyValue(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, Element element, String attribute)
      Sets the property with the given attribute name on the given BeanDefinitionBuilder to the value of the attribute with the given name if the attribute is configured.
      Parameters:
      builder - must not be null.
      element - must not be null.
      attribute - must not be null or empty.
    • setPropertyReference

      public static void setPropertyReference(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, Element element, String attribute, String property)
      Configures a bean property reference with the value of the attribute of the given name if it is configured.
      Parameters:
      builder - must not be null.
      element - must not be null.
      attribute - must not be null or empty.
      property - must not be nullor empty.
    • getSourceBeanDefinition

      public static org.springframework.beans.factory.support.AbstractBeanDefinition getSourceBeanDefinition(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, org.springframework.beans.factory.xml.ParserContext context, Element element)
      Returns the BeanDefinition built by the given BeanDefinitionBuilder enriched with source information derived from the given Element.
      Parameters:
      builder - must not be null.
      context - must not be null.
      element - must not be null.
      Returns:
    • getSourceBeanDefinition

      public static org.springframework.beans.factory.support.AbstractBeanDefinition getSourceBeanDefinition(org.springframework.beans.factory.support.BeanDefinitionBuilder builder, @Nullable Object source)
      Returns the AbstractBeanDefinition built by the given builder with the given extracted source applied.
      Parameters:
      builder - must not be null.
      source -
      Returns:
    • getObjectFactoryBeanDefinition

      public static org.springframework.beans.factory.support.AbstractBeanDefinition getObjectFactoryBeanDefinition(String targetBeanName, @Nullable Object source)
      Returns a BeanDefinition for an ObjectFactoryCreatingFactoryBean pointing to the bean with the given name.
      Parameters:
      targetBeanName - must not be null or empty.
      source -
      Returns: