类 SimpleAutowireCandidateResolver
- java.lang.Object
- org.springframework.beans.factory.support.SimpleAutowireCandidateResolver
- 所有已实现的接口:
AutowireCandidateResolver
public class SimpleAutowireCandidateResolver extends Object implements AutowireCandidateResolver
AutowireCandidateResolver
implementation to use when no annotation support is available. This implementation checks the bean definition only.- 从以下版本开始:
- 2.5
- 作者:
- Mark Fisher, Juergen Hoeller
字段概要
字段 修饰符和类型 字段 说明 static SimpleAutowireCandidateResolver
INSTANCE
Shared instance ofSimpleAutowireCandidateResolver
.
构造器概要
构造器 构造器 说明 SimpleAutowireCandidateResolver()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 AutowireCandidateResolver
cloneIfNecessary()
This implementation returnsthis
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.
字段详细资料
INSTANCE
public static final SimpleAutowireCandidateResolver INSTANCE
Shared instance ofSimpleAutowireCandidateResolver
.- 从以下版本开始:
- 5.2.7
构造器详细资料
SimpleAutowireCandidateResolver
public SimpleAutowireCandidateResolver()
方法详细资料
isAutowireCandidate
public boolean isAutowireCandidate(BeanDefinitionHolder bdHolder, DependencyDescriptor descriptor)
从接口复制的说明:AutowireCandidateResolver
Determine whether the given bean definition qualifies as an autowire candidate for the given dependency.The default implementation checks
BeanDefinition.isAutowireCandidate()
.- 指定者:
isAutowireCandidate
在接口中AutowireCandidateResolver
- 参数:
bdHolder
- the bean definition including bean name and aliasesdescriptor
- the descriptor for the target method parameter or field- 返回:
- whether the bean definition qualifies as autowire candidate
- 另请参阅:
BeanDefinition.isAutowireCandidate()
isRequired
public boolean isRequired(DependencyDescriptor descriptor)
从接口复制的说明:AutowireCandidateResolver
Determine whether the given descriptor is effectively required.The default implementation checks
DependencyDescriptor.isRequired()
.- 指定者:
isRequired
在接口中AutowireCandidateResolver
- 参数:
descriptor
- the descriptor for the target method parameter or field- 返回:
- whether the descriptor is marked as required or possibly indicating non-required status some other way (e.g. through a parameter annotation)
- 另请参阅:
DependencyDescriptor.isRequired()
hasQualifier
public boolean hasQualifier(DependencyDescriptor descriptor)
从接口复制的说明:AutowireCandidateResolver
Determine whether the given descriptor declares a qualifier beyond the type (typically - but not necessarily - a specific kind of annotation).The default implementation returns
false
.- 指定者:
hasQualifier
在接口中AutowireCandidateResolver
- 参数:
descriptor
- the descriptor for the target method parameter or field- 返回:
- whether the descriptor declares a qualifier, narrowing the candidate status beyond the type match
- 另请参阅:
QualifierAnnotationAutowireCandidateResolver.hasQualifier(org.springframework.beans.factory.config.DependencyDescriptor)
getSuggestedValue
@Nullable public Object getSuggestedValue(DependencyDescriptor descriptor)
从接口复制的说明:AutowireCandidateResolver
Determine whether a default value is suggested for the given dependency.The default implementation simply returns
null
.- 指定者:
getSuggestedValue
在接口中AutowireCandidateResolver
- 参数:
descriptor
- the descriptor for the target method parameter or field- 返回:
- the value suggested (typically an expression String), or
null
if none found
getLazyResolutionProxyIfNecessary
@Nullable public Object getLazyResolutionProxyIfNecessary(DependencyDescriptor descriptor, @Nullable String beanName)
从接口复制的说明:AutowireCandidateResolver
Build a proxy for lazy resolution of the actual dependency target, if demanded by the injection point.The default implementation simply returns
null
.- 指定者:
getLazyResolutionProxyIfNecessary
在接口中AutowireCandidateResolver
- 参数:
descriptor
- the descriptor for the target method parameter or fieldbeanName
- the name of the bean that contains the injection point- 返回:
- the lazy resolution proxy for the actual dependency target, or
null
if straight resolution is to be performed
cloneIfNecessary
public AutowireCandidateResolver cloneIfNecessary()
This implementation returnsthis
as-is.- 指定者:
cloneIfNecessary
在接口中AutowireCandidateResolver
- 另请参阅:
INSTANCE