|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.beans.factory.support.BeanDefinitionValueResolver
class BeanDefinitionValueResolver
Helper class for use in bean factory implementations, resolving values contained in bean definition objects into the actual values applied to the target bean instance.
Operates on an AbstractBeanFactory
and a plain
BeanDefinition
object.
Used by AbstractAutowireCapableBeanFactory
.
AbstractAutowireCapableBeanFactory
Nested Class Summary | |
---|---|
private static class |
BeanDefinitionValueResolver.KeyedArgName
Holder class used for delayed toString building. |
Field Summary | |
---|---|
private BeanDefinition |
beanDefinition
|
private AbstractBeanFactory |
beanFactory
|
private java.lang.String |
beanName
|
private TypeConverter |
typeConverter
|
Constructor Summary | |
---|---|
BeanDefinitionValueResolver(AbstractBeanFactory beanFactory,
java.lang.String beanName,
BeanDefinition beanDefinition,
TypeConverter typeConverter)
Create a BeanDefinitionValueResolver for the given BeanFactory and BeanDefinition. |
Method Summary | |
---|---|
private java.lang.String |
adaptInnerBeanName(java.lang.String innerBeanName)
Checks the given bean name whether it is unique. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final AbstractBeanFactory beanFactory
private final java.lang.String beanName
private final BeanDefinition beanDefinition
private final TypeConverter typeConverter
Constructor Detail |
---|
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 TypedStringValuesMethod Detail |
---|
public 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 resolve
protected 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 candidate value (may be an expression)
protected java.lang.Class<?> resolveTargetType(TypedStringValue value) throws java.lang.ClassNotFoundException
value
- the TypedStringValue to resolve
null
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 bean
private java.lang.String adaptInnerBeanName(java.lang.String innerBeanName)
innerBeanName
- the original name for the inner bean
private 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)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |