Top Description Fields Constructors Methods
org.springframework.beans.factory.config

public Class BeanDefinitionVisitor

extends Object
Class Inheritance
Imports
java.util.LinkedHashMap, .LinkedHashSet, .List, .Map, .Set, org.springframework.beans.MutablePropertyValues, .PropertyValue, org.springframework.lang.Nullable, org.springframework.util.Assert, .ObjectUtils, .StringValueResolver

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.

Authors
Juergen Hoeller, Sam Brannen
Since
1.2
See Also
BeanDefinition, BeanDefinition#getPropertyValues, BeanDefinition#getConstructorArgumentValues, PlaceholderConfigurerSupport

Field Summary

Modifier and TypeField and Description
private StringValueResolver

Constructor Summary

AccessConstructor and Description
public
BeanDefinitionVisitor(StringValueResolver
the StringValueResolver to apply
valueResolver
)

Create a new BeanDefinitionVisitor, applying the specified value resolver to all bean metadata values.

protected
BeanDefinitionVisitor()

Create a new BeanDefinitionVisitor for subclassing.

Method Summary

Modifier and TypeMethod and Description
protected String

Returns:

the resolved String value
resolveStringValue
(String
the original String value
strVal
)

Resolve the given String value, for example parsing placeholders.

protected Object
protected void
visitArray(Object[] arrayVal)

protected void
public void
visitBeanDefinition(BeanDefinition
the BeanDefinition object to traverse
beanDefinition
)

Traverse the given BeanDefinition object and the MutablePropertyValues and ConstructorArgumentValues contained in them.

protected void
protected void
protected void
protected void
protected void
visitList(List<E> listVal)

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

protected void
protected void
protected void
visitScope(BeanDefinition beanDefinition)

protected void
visitSet(Set<E> setVal)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

valueResolverback to summary
private StringValueResolver valueResolver
Annotations
@Nullable

Constructor Detail

BeanDefinitionVisitorback to summary
public BeanDefinitionVisitor(StringValueResolver valueResolver)

Create a new BeanDefinitionVisitor, applying the specified value resolver to all bean metadata values.

Parameters
valueResolver:StringValueResolver

the StringValueResolver to apply

BeanDefinitionVisitorback to summary
protected BeanDefinitionVisitor()

Create a new BeanDefinitionVisitor for subclassing. Subclasses need to override the resolveStringValue method.

Method Detail

resolveStringValueback to summary
protected String resolveStringValue(String strVal)

Resolve the given String value, for example parsing placeholders.

Parameters
strVal:String

the original String value

Returns:String

the resolved String value

Annotations
@Nullable
resolveValueback to summary
protected Object resolveValue(Object value)
Annotations
@SuppressWarnings:rawtypes
@Nullable
visitArrayback to summary
protected void visitArray(Object[] arrayVal)
visitBeanClassNameback to summary
protected void visitBeanClassName(BeanDefinition beanDefinition)
visitBeanDefinitionback to summary
public void visitBeanDefinition(BeanDefinition beanDefinition)

Traverse the given BeanDefinition object and the MutablePropertyValues and ConstructorArgumentValues contained in them.

Parameters
beanDefinition:BeanDefinition

the BeanDefinition object to traverse

See Also
resolveStringValue(String)
visitFactoryBeanNameback to summary
protected void visitFactoryBeanName(BeanDefinition beanDefinition)
visitFactoryMethodNameback to summary
protected void visitFactoryMethodName(BeanDefinition beanDefinition)
visitGenericArgumentValuesback to summary
protected void visitGenericArgumentValues(List<ConstructorArgumentValues.ValueHolder> gas)
visitIndexedArgumentValuesback to summary
protected void visitIndexedArgumentValues(Map<Integer, ConstructorArgumentValues.ValueHolder> ias)
visitListback to summary
protected void visitList(List<E> listVal)
Annotations
@SuppressWarnings:rawtypes, unchecked
visitMapback to summary
protected void visitMap(Map<?, ?> mapVal)
Annotations
@SuppressWarnings:rawtypes, unchecked
visitParentNameback to summary
protected void visitParentName(BeanDefinition beanDefinition)
visitPropertyValuesback to summary
protected void visitPropertyValues(MutablePropertyValues pvs)
visitScopeback to summary
protected void visitScope(BeanDefinition beanDefinition)
visitSetback to summary
protected void visitSet(Set<E> setVal)
Annotations
@SuppressWarnings:rawtypes, unchecked