Class SimpleAutowireCandidateResolver
java.lang.Object
org.springframework.beans.factory.support.SimpleAutowireCandidateResolver
- All Implemented Interfaces:
- AutowireCandidateResolver
- Direct Known Subclasses:
- GenericTypeAwareAutowireCandidateResolver
AutowireCandidateResolver implementation to use when no annotation
 support is available. This implementation checks the bean definition only.- Since:
- 2.5
- Author:
- Mark Fisher, Juergen Hoeller
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final SimpleAutowireCandidateResolverShared instance ofSimpleAutowireCandidateResolver.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionThis implementation returnsthisas-is.Class<?>getLazyResolutionProxyClass(DependencyDescriptor descriptor, String beanName) Determine the proxy class for lazy resolution of the dependency target, if demanded by the injection point.getLazyResolutionProxyIfNecessary(DependencyDescriptor descriptor, String beanName) Build a proxy for lazy resolution of the actual dependency target, if demanded by the injection point.getSuggestedValue(DependencyDescriptor descriptor) Determine whether a default value is suggested for the given dependency.booleanhasQualifier(DependencyDescriptor descriptor) Determine whether the given descriptor declares a qualifier beyond the type (typically - but not necessarily - a specific kind of annotation).booleanisAutowireCandidate(BeanDefinitionHolder bdHolder, DependencyDescriptor descriptor) Determine whether the given bean definition qualifies as an autowire candidate for the given dependency.booleanisRequired(DependencyDescriptor descriptor) Determine whether the given descriptor is effectively required.
- 
Field Details- 
INSTANCEShared instance ofSimpleAutowireCandidateResolver.- Since:
- 5.2.7
 
 
- 
- 
Constructor Details- 
SimpleAutowireCandidateResolverpublic SimpleAutowireCandidateResolver()
 
- 
- 
Method Details- 
isAutowireCandidateDescription copied from interface:AutowireCandidateResolverDetermine whether the given bean definition qualifies as an autowire candidate for the given dependency.The default implementation checks BeanDefinition.isAutowireCandidate().- Specified by:
- isAutowireCandidatein interface- AutowireCandidateResolver
- Parameters:
- bdHolder- the bean definition including bean name and aliases
- descriptor- the descriptor for the target method parameter or field
- Returns:
- whether the bean definition qualifies as autowire candidate
- See Also:
 
- 
isRequiredDescription copied from interface:AutowireCandidateResolverDetermine whether the given descriptor is effectively required.The default implementation checks DependencyDescriptor.isRequired().- Specified by:
- isRequiredin interface- AutowireCandidateResolver
- Parameters:
- descriptor- the descriptor for the target method parameter or field
- Returns:
- whether the descriptor is marked as required or possibly indicating non-required status some other way (e.g. through a parameter annotation)
- See Also:
 
- 
hasQualifierDescription copied from interface:AutowireCandidateResolverDetermine whether the given descriptor declares a qualifier beyond the type (typically - but not necessarily - a specific kind of annotation).The default implementation returns false.- Specified by:
- hasQualifierin interface- AutowireCandidateResolver
- Parameters:
- descriptor- the descriptor for the target method parameter or field
- Returns:
- whether the descriptor declares a qualifier, narrowing the candidate status beyond the type match
- See Also:
 
- 
getSuggestedValueDescription copied from interface:AutowireCandidateResolverDetermine whether a default value is suggested for the given dependency.The default implementation simply returns null.- Specified by:
- getSuggestedValuein interface- AutowireCandidateResolver
- Parameters:
- descriptor- the descriptor for the target method parameter or field
- Returns:
- the value suggested (typically an expression String),
 or nullif none found
 
- 
getLazyResolutionProxyIfNecessary@Nullable public Object getLazyResolutionProxyIfNecessary(DependencyDescriptor descriptor, @Nullable String beanName) Description copied from interface:AutowireCandidateResolverBuild a proxy for lazy resolution of the actual dependency target, if demanded by the injection point.The default implementation simply returns null.- Specified by:
- getLazyResolutionProxyIfNecessaryin interface- AutowireCandidateResolver
- Parameters:
- descriptor- the descriptor for the target method parameter or field
- beanName- the name of the bean that contains the injection point
- Returns:
- the lazy resolution proxy for the actual dependency target,
 or nullif straight resolution is to be performed
 
- 
getLazyResolutionProxyClass@Nullable public Class<?> getLazyResolutionProxyClass(DependencyDescriptor descriptor, @Nullable String beanName) Description copied from interface:AutowireCandidateResolverDetermine the proxy class for lazy resolution of the dependency target, if demanded by the injection point.The default implementation simply returns null.- Specified by:
- getLazyResolutionProxyClassin interface- AutowireCandidateResolver
- Parameters:
- descriptor- the descriptor for the target method parameter or field
- beanName- the name of the bean that contains the injection point
- Returns:
- the lazy resolution proxy class for the dependency target, if any
 
- 
cloneIfNecessaryThis implementation returnsthisas-is.- Specified by:
- cloneIfNecessaryin interface- AutowireCandidateResolver
- See Also:
 
 
-