class BeanDefinitionValueResolver
extends java.lang.Object
Operates on an AbstractBeanFactory
and a plain
BeanDefinition
object.
Used by AbstractAutowireCapableBeanFactory
.
AbstractAutowireCapableBeanFactory
Modifier and Type | Class and Description |
---|---|
private static class |
BeanDefinitionValueResolver.KeyedArgName
Holder class used for delayed toString building.
|
Modifier and Type | Field and Description |
---|---|
private BeanDefinition |
beanDefinition |
private AbstractBeanFactory |
beanFactory |
private java.lang.String |
beanName |
private TypeConverter |
typeConverter |
Constructor and Description |
---|
BeanDefinitionValueResolver(AbstractBeanFactory beanFactory,
java.lang.String beanName,
BeanDefinition beanDefinition,
TypeConverter typeConverter)
Create a BeanDefinitionValueResolver for the given BeanFactory and BeanDefinition.
|
Modifier and Type | Method and Description |
---|---|
private java.lang.String |
adaptInnerBeanName(java.lang.String innerBeanName)
Checks the given bean name whether it is unique.
|
private java.lang.Object |
doEvaluate(java.lang.String value)
Evaluate the given String value as an expression, if necessary.
|
protected java.lang.Object |
evaluate(java.lang.Object value)
Evaluate the given value as an expression, if necessary.
|
protected java.lang.Object |
evaluate(TypedStringValue value)
Evaluate the given value as an expression, if necessary.
|
private java.lang.Object |
resolveInnerBean(java.lang.Object argName,
java.lang.String innerBeanName,
BeanDefinition innerBd)
Resolve an inner bean definition.
|
private java.lang.Object |
resolveManagedArray(java.lang.Object argName,
java.util.List<?> ml,
java.lang.Class<?> elementType)
For each element in the managed array, resolve reference if necessary.
|
private java.util.List<?> |
resolveManagedList(java.lang.Object argName,
java.util.List<?> ml)
For each element in the managed list, resolve reference if necessary.
|
private java.util.Map<?,?> |
resolveManagedMap(java.lang.Object argName,
java.util.Map<?,?> mm)
For each element in the managed map, resolve reference if necessary.
|
private java.util.Set<?> |
resolveManagedSet(java.lang.Object argName,
java.util.Set<?> ms)
For each element in the managed set, resolve reference if necessary.
|
private java.lang.Object |
resolveReference(java.lang.Object argName,
RuntimeBeanReference ref)
Resolve a reference to another bean in the factory.
|
protected java.lang.Class<?> |
resolveTargetType(TypedStringValue value)
Resolve the target type in the given TypedStringValue.
|
java.lang.Object |
resolveValueIfNecessary(java.lang.Object argName,
java.lang.Object value)
Given a PropertyValue, return a value, resolving any references to other
beans in the factory if necessary.
|
private final AbstractBeanFactory beanFactory
private final java.lang.String beanName
private final BeanDefinition beanDefinition
private final TypeConverter typeConverter
public BeanDefinitionValueResolver(AbstractBeanFactory beanFactory, java.lang.String beanName, BeanDefinition beanDefinition, TypeConverter typeConverter)
beanFactory
- the BeanFactory to resolve againstbeanName
- the name of the bean that we work onbeanDefinition
- the BeanDefinition of the bean that we work ontypeConverter
- the TypeConverter to use for resolving TypedStringValuespublic java.lang.Object resolveValueIfNecessary(java.lang.Object argName, java.lang.Object value)
null
, in which case it's left alone.argName
- the name of the argument that the value is defined forvalue
- the value object to resolveprotected java.lang.Object evaluate(TypedStringValue value)
value
- the candidate value (may be an expression)protected java.lang.Object evaluate(java.lang.Object value)
value
- the original value (may be an expression)private java.lang.Object doEvaluate(java.lang.String value)
value
- the original value (may be an expression)protected java.lang.Class<?> resolveTargetType(TypedStringValue value) throws java.lang.ClassNotFoundException
value
- the TypedStringValue to resolvenull
if none specified)java.lang.ClassNotFoundException
- if the specified type cannot be resolvedTypedStringValue.resolveTargetType(java.lang.ClassLoader)
private java.lang.Object resolveInnerBean(java.lang.Object argName, java.lang.String innerBeanName, BeanDefinition innerBd)
argName
- the name of the argument that the inner bean is defined forinnerBeanName
- the name of the inner beaninnerBd
- the bean definition for the inner beanprivate java.lang.String adaptInnerBeanName(java.lang.String innerBeanName)
innerBeanName
- the original name for the inner beanprivate java.lang.Object resolveReference(java.lang.Object argName, RuntimeBeanReference ref)
private java.lang.Object resolveManagedArray(java.lang.Object argName, java.util.List<?> ml, java.lang.Class<?> elementType)
private java.util.List<?> resolveManagedList(java.lang.Object argName, java.util.List<?> ml)
private java.util.Set<?> resolveManagedSet(java.lang.Object argName, java.util.Set<?> ms)
private java.util.Map<?,?> resolveManagedMap(java.lang.Object argName, java.util.Map<?,?> mm)