Class BeanDefinitionVisitor
- java.lang.Object
- org.springframework.beans.factory.config.BeanDefinitionVisitor
public class BeanDefinitionVisitor extends Object
Visitor class for traversingBeanDefinitionobjects, in particular the property values and constructor argument values contained in them, resolving bean metadata values.Used by
PropertyPlaceholderConfigurerto parse all String values contained in a BeanDefinition, resolving any placeholders found.- Since:
- 1.2
- Author:
- Juergen Hoeller, Sam Brannen
- See Also:
BeanDefinition,BeanDefinition.getPropertyValues(),BeanDefinition.getConstructorArgumentValues(),PropertyPlaceholderConfigurer
Constructor Summary
Constructors Modifier Constructor Description protectedBeanDefinitionVisitor()Create a new BeanDefinitionVisitor for subclassing.BeanDefinitionVisitor(StringValueResolver valueResolver)Create a new BeanDefinitionVisitor, applying the specified value resolver to all bean metadata values.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringresolveStringValue(String strVal)Resolve the given String value, for example parsing placeholders.protected ObjectresolveValue(Object value)protected voidvisitArray(Object[] arrayVal)protected voidvisitBeanClassName(BeanDefinition beanDefinition)voidvisitBeanDefinition(BeanDefinition beanDefinition)Traverse the given BeanDefinition object and the MutablePropertyValues and ConstructorArgumentValues contained in them.protected voidvisitFactoryBeanName(BeanDefinition beanDefinition)protected voidvisitFactoryMethodName(BeanDefinition beanDefinition)protected voidvisitGenericArgumentValues(List<ConstructorArgumentValues.ValueHolder> gas)protected voidvisitIndexedArgumentValues(Map<Integer,ConstructorArgumentValues.ValueHolder> ias)protected voidvisitList(List listVal)protected voidvisitMap(Map<?,?> mapVal)protected voidvisitParentName(BeanDefinition beanDefinition)protected voidvisitPropertyValues(MutablePropertyValues pvs)protected voidvisitScope(BeanDefinition beanDefinition)protected voidvisitSet(Set setVal)
Constructor Detail
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 theresolveStringValue(java.lang.String)method.
Method Detail
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:
resolveStringValue(String)
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
protected Object resolveValue(Object value)
visitArray
protected void visitArray(Object[] arrayVal)
resolveStringValue
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