Class BeanDefinitionVisitor

java.lang.Object
org.springframework.beans.factory.config.BeanDefinitionVisitor

public class BeanDefinitionVisitor extends Object
Visitor class for traversing BeanDefinition objects, in particular the property values and constructor argument values contained in them, resolving bean metadata values.

Used by PlaceholderConfigurerSupport to parse all String values contained in a BeanDefinition, resolving any placeholders found.

Since:
1.2
Author:
Juergen Hoeller, Sam Brannen
See Also:
  • Constructor Details

    • BeanDefinitionVisitor

      public BeanDefinitionVisitor(StringValueResolver valueResolver)
      Create a new BeanDefinitionVisitor, applying the specified value resolver to all bean metadata values.
      Parameters:
      valueResolver - the StringValueResolver to apply
    • BeanDefinitionVisitor

      protected BeanDefinitionVisitor()
      Create a new BeanDefinitionVisitor for subclassing. Subclasses need to override the resolveStringValue(java.lang.String) method.
  • Method Details

    • visitBeanDefinition

      public void visitBeanDefinition(BeanDefinition beanDefinition)
      Traverse the given BeanDefinition object and the MutablePropertyValues and ConstructorArgumentValues contained in them.
      Parameters:
      beanDefinition - the BeanDefinition object to traverse
      See Also:
    • visitParentName

      protected void visitParentName(BeanDefinition beanDefinition)
    • visitBeanClassName

      protected void visitBeanClassName(BeanDefinition beanDefinition)
    • visitFactoryBeanName

      protected void visitFactoryBeanName(BeanDefinition beanDefinition)
    • visitFactoryMethodName

      protected void visitFactoryMethodName(BeanDefinition beanDefinition)
    • visitScope

      protected void visitScope(BeanDefinition beanDefinition)
    • visitPropertyValues

      protected void visitPropertyValues(MutablePropertyValues pvs)
    • visitIndexedArgumentValues

      protected void visitIndexedArgumentValues(Map<Integer,ConstructorArgumentValues.ValueHolder> ias)
    • visitGenericArgumentValues

      protected void visitGenericArgumentValues(List<ConstructorArgumentValues.ValueHolder> gas)
    • resolveValue

      @Nullable protected Object resolveValue(@Nullable Object value)
    • visitArray

      protected void visitArray(Object[] arrayVal)
    • visitList

      protected void visitList(List listVal)
    • visitSet

      protected void visitSet(Set setVal)
    • visitMap

      protected void visitMap(Map<?,?> mapVal)
    • resolveStringValue

      @Nullable protected String resolveStringValue(String strVal)
      Resolve the given String value, for example parsing placeholders.
      Parameters:
      strVal - the original String value
      Returns:
      the resolved String value