public class SimpleAutowireCandidateResolver extends Object implements AutowireCandidateResolver
AutowireCandidateResolver
implementation to use when no annotation
support is available. This implementation checks the bean definition only.Modifier and Type | Field and Description |
---|---|
static SimpleAutowireCandidateResolver |
INSTANCE
Shared instance of
SimpleAutowireCandidateResolver . |
Constructor and Description |
---|
SimpleAutowireCandidateResolver() |
Modifier and Type | Method and Description |
---|---|
AutowireCandidateResolver |
cloneIfNecessary()
This implementation returns
this as-is. |
Object |
getLazyResolutionProxyIfNecessary(DependencyDescriptor descriptor,
String beanName)
Build a proxy for lazy resolution of the actual dependency target,
if demanded by the injection point.
|
Object |
getSuggestedValue(DependencyDescriptor descriptor)
Determine whether a default value is suggested for the given dependency.
|
boolean |
hasQualifier(DependencyDescriptor descriptor)
Determine whether the given descriptor declares a qualifier beyond the type
(typically - but not necessarily - a specific kind of annotation).
|
boolean |
isAutowireCandidate(BeanDefinitionHolder bdHolder,
DependencyDescriptor descriptor)
Determine whether the given bean definition qualifies as an
autowire candidate for the given dependency.
|
boolean |
isRequired(DependencyDescriptor descriptor)
Determine whether the given descriptor is effectively required.
|
public static final SimpleAutowireCandidateResolver INSTANCE
SimpleAutowireCandidateResolver
.public boolean isAutowireCandidate(BeanDefinitionHolder bdHolder, DependencyDescriptor descriptor)
AutowireCandidateResolver
The default implementation checks
BeanDefinition.isAutowireCandidate()
.
isAutowireCandidate
in interface AutowireCandidateResolver
bdHolder
- the bean definition including bean name and aliasesdescriptor
- the descriptor for the target method parameter or fieldBeanDefinition.isAutowireCandidate()
public boolean isRequired(DependencyDescriptor descriptor)
AutowireCandidateResolver
The default implementation checks DependencyDescriptor.isRequired()
.
isRequired
in interface AutowireCandidateResolver
descriptor
- the descriptor for the target method parameter or fieldDependencyDescriptor.isRequired()
public boolean hasQualifier(DependencyDescriptor descriptor)
AutowireCandidateResolver
The default implementation returns false
.
hasQualifier
in interface AutowireCandidateResolver
descriptor
- the descriptor for the target method parameter or fieldQualifierAnnotationAutowireCandidateResolver.hasQualifier(org.springframework.beans.factory.config.DependencyDescriptor)
@Nullable public Object getSuggestedValue(DependencyDescriptor descriptor)
AutowireCandidateResolver
The default implementation simply returns null
.
getSuggestedValue
in interface AutowireCandidateResolver
descriptor
- the descriptor for the target method parameter or fieldnull
if none found@Nullable public Object getLazyResolutionProxyIfNecessary(DependencyDescriptor descriptor, @Nullable String beanName)
AutowireCandidateResolver
The default implementation simply returns null
.
getLazyResolutionProxyIfNecessary
in interface AutowireCandidateResolver
descriptor
- 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 performedpublic AutowireCandidateResolver cloneIfNecessary()
this
as-is.cloneIfNecessary
in interface AutowireCandidateResolver
INSTANCE