public interface AutowireCandidateResolver
Modifier and Type | Method and Description |
---|---|
default AutowireCandidateResolver |
cloneIfNecessary()
Return a clone of this resolver instance if necessary, retaining its local
configuration and allowing for the cloned instance to get associated with
a new bean factory, or this original instance if there is no such state.
|
default Object |
getLazyResolutionProxyIfNecessary(DependencyDescriptor descriptor,
String beanName)
Build a proxy for lazy resolution of the actual dependency target,
if demanded by the injection point.
|
default Object |
getSuggestedValue(DependencyDescriptor descriptor)
Determine whether a default value is suggested for the given dependency.
|
default boolean |
hasQualifier(DependencyDescriptor descriptor)
Determine whether the given descriptor declares a qualifier beyond the type
(typically - but not necessarily - a specific kind of annotation).
|
default boolean |
isAutowireCandidate(BeanDefinitionHolder bdHolder,
DependencyDescriptor descriptor)
Determine whether the given bean definition qualifies as an
autowire candidate for the given dependency.
|
default boolean |
isRequired(DependencyDescriptor descriptor)
Determine whether the given descriptor is effectively required.
|
default boolean isAutowireCandidate(BeanDefinitionHolder bdHolder, DependencyDescriptor descriptor)
The default implementation checks
BeanDefinition.isAutowireCandidate()
.
bdHolder
- the bean definition including bean name and aliasesdescriptor
- the descriptor for the target method parameter or fieldBeanDefinition.isAutowireCandidate()
default boolean isRequired(DependencyDescriptor descriptor)
The default implementation checks DependencyDescriptor.isRequired()
.
descriptor
- the descriptor for the target method parameter or fieldDependencyDescriptor.isRequired()
default boolean hasQualifier(DependencyDescriptor descriptor)
The default implementation returns false
.
descriptor
- the descriptor for the target method parameter or fieldQualifierAnnotationAutowireCandidateResolver.hasQualifier(org.springframework.beans.factory.config.DependencyDescriptor)
@Nullable default Object getSuggestedValue(DependencyDescriptor descriptor)
The default implementation simply returns null
.
descriptor
- the descriptor for the target method parameter or fieldnull
if none found@Nullable default Object getLazyResolutionProxyIfNecessary(DependencyDescriptor descriptor, @Nullable String beanName)
The default implementation simply returns null
.
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 performeddefault AutowireCandidateResolver cloneIfNecessary()
The default implementation creates a separate instance via the default
class constructor, assuming no specific configuration state to copy.
Subclasses may override this with custom configuration state handling
or with standard Cloneable
support (as implemented by Spring's
own configurable AutowireCandidateResolver
variants), or simply
return this
(as in SimpleAutowireCandidateResolver
).