Class SimpleAutowireCandidateResolver
- java.lang.Object
- org.springframework.beans.factory.support.SimpleAutowireCandidateResolver
- All Implemented Interfaces:
AutowireCandidateResolver
- Direct Known Subclasses:
GenericTypeAwareAutowireCandidateResolver
public class SimpleAutowireCandidateResolver extends Object implements AutowireCandidateResolver
AutowireCandidateResolverimplementation to use when no annotation support is available. This implementation checks the bean definition only.- Since:
- 2.5
- Author:
- Mark Fisher, Juergen Hoeller
Constructor Summary
Constructors Constructor Description SimpleAutowireCandidateResolver()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetLazyResolutionProxyIfNecessary(DependencyDescriptor descriptor, String beanName)Build a proxy for lazy resolution of the actual dependency target, if demanded by the injection point.ObjectgetSuggestedValue(DependencyDescriptor descriptor)Determine whether a default value is suggested for the given dependency.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.
Constructor Detail
SimpleAutowireCandidateResolver
public SimpleAutowireCandidateResolver()
Method Detail
isAutowireCandidate
public boolean isAutowireCandidate(BeanDefinitionHolder bdHolder, DependencyDescriptor descriptor)
Description copied from interface:AutowireCandidateResolverDetermine whether the given bean definition qualifies as an autowire candidate for the given dependency.- Specified by:
isAutowireCandidatein interfaceAutowireCandidateResolver- Parameters:
bdHolder- the bean definition including bean name and aliasesdescriptor- the descriptor for the target method parameter or field- Returns:
- whether the bean definition qualifies as autowire candidate
isRequired
public boolean isRequired(DependencyDescriptor descriptor)
Determine whether the given descriptor is effectively required.The default implementation checks
DependencyDescriptor.isRequired().- 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)
- Since:
- 4.3.9
- See Also:
DependencyDescriptor.isRequired()
getSuggestedValue
public Object getSuggestedValue(DependencyDescriptor descriptor)
Description copied from interface:AutowireCandidateResolverDetermine whether a default value is suggested for the given dependency.- Specified by:
getSuggestedValuein interfaceAutowireCandidateResolver- Parameters:
descriptor- the descriptor for the target method parameter or field- Returns:
- the value suggested (typically an expression String), or
nullif none found
getLazyResolutionProxyIfNecessary
public Object getLazyResolutionProxyIfNecessary(DependencyDescriptor descriptor, String beanName)
Description copied from interface:AutowireCandidateResolverBuild a proxy for lazy resolution of the actual dependency target, if demanded by the injection point.- Specified by:
getLazyResolutionProxyIfNecessaryin interfaceAutowireCandidateResolver- Parameters:
descriptor- the descriptor for the target method parameter or fieldbeanName- 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