public class GenericTypeAwareAutowireCandidateResolver extends Object implements AutowireCandidateResolver, BeanFactoryAware
AutowireCandidateResolver that performs a full generic type
match with the candidate's type if the dependency is declared as a generic type
(e.g. Repository<Customer>).
This is the base class for
QualifierAnnotationAutowireCandidateResolver,
providing an implementation all non-annotation-based resolution steps at this level.
| Constructor and Description |
|---|
GenericTypeAwareAutowireCandidateResolver() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkGenericTypeMatch(BeanDefinitionHolder bdHolder,
DependencyDescriptor descriptor)
Match the given dependency type with its generic type information against the given
candidate bean definition.
|
protected BeanFactory |
getBeanFactory() |
Object |
getLazyResolutionProxyIfNecessary(DependencyDescriptor descriptor,
String beanName)
This implementation always returns
null, leaving lazy resolution support up
to subclasses. |
protected RootBeanDefinition |
getResolvedDecoratedDefinition(RootBeanDefinition rbd) |
protected org.springframework.core.ResolvableType |
getReturnTypeForFactoryMethod(RootBeanDefinition rbd,
DependencyDescriptor descriptor) |
Object |
getSuggestedValue(DependencyDescriptor descriptor)
This implementation always returns
null, leaving suggested value support up
to subclasses. |
boolean |
isAutowireCandidate(BeanDefinitionHolder bdHolder,
DependencyDescriptor descriptor)
Determine whether the given bean definition qualifies as an
autowire candidate for the given dependency.
|
void |
setBeanFactory(BeanFactory beanFactory)
Callback that supplies the owning factory to a bean instance.
|
public GenericTypeAwareAutowireCandidateResolver()
public void setBeanFactory(BeanFactory beanFactory)
BeanFactoryAwareInvoked after the population of normal bean properties
but before an initialization callback such as
InitializingBean.afterPropertiesSet() or a custom init-method.
setBeanFactory in interface BeanFactoryAwarebeanFactory - owning BeanFactory (never null).
The bean can immediately call methods on the factory.BeanInitializationExceptionprotected final BeanFactory getBeanFactory()
public boolean isAutowireCandidate(BeanDefinitionHolder bdHolder, DependencyDescriptor descriptor)
AutowireCandidateResolverisAutowireCandidate in interface AutowireCandidateResolverbdHolder - the bean definition including bean name and aliasesdescriptor - the descriptor for the target method parameter or fieldprotected boolean checkGenericTypeMatch(BeanDefinitionHolder bdHolder, DependencyDescriptor descriptor)
protected RootBeanDefinition getResolvedDecoratedDefinition(RootBeanDefinition rbd)
protected org.springframework.core.ResolvableType getReturnTypeForFactoryMethod(RootBeanDefinition rbd, DependencyDescriptor descriptor)
public Object getSuggestedValue(DependencyDescriptor descriptor)
null, leaving suggested value support up
to subclasses.getSuggestedValue in interface AutowireCandidateResolverdescriptor - the descriptor for the target method parameter or fieldnull if none foundpublic Object getLazyResolutionProxyIfNecessary(DependencyDescriptor descriptor, String beanName)
null, leaving lazy resolution support up
to subclasses.getLazyResolutionProxyIfNecessary in interface AutowireCandidateResolverdescriptor - the descriptor for the target method parameter or fieldbeanName - the name of the bean that contains the injection pointnull if straight resolution is to be performed