Top Description Fields Constructors Methods
org.springframework.beans.factory.support

public Class SimpleAutowireCandidateResolver

extends Object
implements AutowireCandidateResolver
Class Inheritance
All Implemented Interfaces
org.springframework.beans.factory.support.AutowireCandidateResolver
Known Direct Subclasses
org.springframework.beans.factory.support.GenericTypeAwareAutowireCandidateResolver
Imports
org.springframework.beans.factory.config.BeanDefinitionHolder, .DependencyDescriptor, org.springframework.lang.Nullable

AutowireCandidateResolver implementation to use when no annotation support is available. This implementation checks the bean definition only.
Authors
Mark Fisher, Juergen Hoeller
Since
2.5

Field Summary

Modifier and TypeField and Description
public static final SimpleAutowireCandidateResolver
INSTANCE

Shared instance of SimpleAutowireCandidateResolver.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public AutowireCandidateResolver
public Class<?>
getLazyResolutionProxyClass(DependencyDescriptor
the descriptor for the target method parameter or field
descriptor
,
String
the name of the bean that contains the injection point
beanName
)

Overrides default org.springframework.beans.factory.support.AutowireCandidateResolver.getLazyResolutionProxyClass.

Determine the proxy class for lazy resolution of the dependency target, if demanded by the injection point.

public Object
getLazyResolutionProxyIfNecessary(DependencyDescriptor
the descriptor for the target method parameter or field
descriptor
,
String
the name of the bean that contains the injection point
beanName
)

Overrides default org.springframework.beans.factory.support.AutowireCandidateResolver.getLazyResolutionProxyIfNecessary.

Build a proxy for lazy resolution of the actual dependency target, if demanded by the injection point.

public Object
getSuggestedValue(DependencyDescriptor
the descriptor for the target method parameter or field
descriptor
)

Overrides default org.springframework.beans.factory.support.AutowireCandidateResolver.getSuggestedValue.

Determine whether a default value is suggested for the given dependency.

public boolean
hasQualifier(DependencyDescriptor
the descriptor for the target method parameter or field
descriptor
)

Overrides default org.springframework.beans.factory.support.AutowireCandidateResolver.hasQualifier.

Determine whether the given descriptor declares a qualifier beyond the type (typically - but not necessarily - a specific kind of annotation).

public boolean
isAutowireCandidate(BeanDefinitionHolder
the bean definition including bean name and aliases
bdHolder
,
DependencyDescriptor
the descriptor for the target method parameter or field
descriptor
)

Overrides default org.springframework.beans.factory.support.AutowireCandidateResolver.isAutowireCandidate.

Determine whether the given bean definition qualifies as an autowire candidate for the given dependency.

public boolean
isRequired(DependencyDescriptor
the descriptor for the target method parameter or field
descriptor
)

Overrides default org.springframework.beans.factory.support.AutowireCandidateResolver.isRequired.

Determine whether the given descriptor is effectively required.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
public static final SimpleAutowireCandidateResolver INSTANCE

Shared instance of SimpleAutowireCandidateResolver.

Since
5.2.7

Constructor Detail

SimpleAutowireCandidateResolverback to summary
public SimpleAutowireCandidateResolver()

Method Detail

cloneIfNecessaryback to summary
public AutowireCandidateResolver cloneIfNecessary()

Overrides default org.springframework.beans.factory.support.AutowireCandidateResolver.cloneIfNecessary.

This implementation returns this as-is.

Annotations
@Override
See Also
INSTANCE
getLazyResolutionProxyClassback to summary
public Class<?> getLazyResolutionProxyClass(DependencyDescriptor descriptor, String beanName)

Overrides default org.springframework.beans.factory.support.AutowireCandidateResolver.getLazyResolutionProxyClass.

Doc from org.springframework.beans.factory.support.AutowireCandidateResolver.getLazyResolutionProxyClass.

Determine the proxy class for lazy resolution of the dependency target, if demanded by the injection point.

The default implementation simply returns null.

Parameters
descriptor:DependencyDescriptor

the descriptor for the target method parameter or field

beanName:String

the name of the bean that contains the injection point

Returns:Class<?>

the lazy resolution proxy class for the dependency target, if any

Annotations
@Override
@Nullable
getLazyResolutionProxyIfNecessaryback to summary
public Object getLazyResolutionProxyIfNecessary(DependencyDescriptor descriptor, String beanName)

Overrides default org.springframework.beans.factory.support.AutowireCandidateResolver.getLazyResolutionProxyIfNecessary.

Doc from org.springframework.beans.factory.support.AutowireCandidateResolver.getLazyResolutionProxyIfNecessary.

Build a proxy for lazy resolution of the actual dependency target, if demanded by the injection point.

The default implementation simply returns null.

Parameters
descriptor:DependencyDescriptor

the descriptor for the target method parameter or field

beanName:String

the name of the bean that contains the injection point

Returns:Object

the lazy resolution proxy for the actual dependency target, or null if straight resolution is to be performed

Annotations
@Override
@Nullable
getSuggestedValueback to summary
public Object getSuggestedValue(DependencyDescriptor descriptor)

Overrides default org.springframework.beans.factory.support.AutowireCandidateResolver.getSuggestedValue.

Doc from org.springframework.beans.factory.support.AutowireCandidateResolver.getSuggestedValue.

Determine whether a default value is suggested for the given dependency.

The default implementation simply returns null.

Parameters
descriptor:DependencyDescriptor

the descriptor for the target method parameter or field

Returns:Object

the value suggested (typically an expression String), or null if none found

Annotations
@Override
@Nullable
hasQualifierback to summary
public boolean hasQualifier(DependencyDescriptor descriptor)

Overrides default org.springframework.beans.factory.support.AutowireCandidateResolver.hasQualifier.

Doc from org.springframework.beans.factory.support.AutowireCandidateResolver.hasQualifier.

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.

Parameters
descriptor:DependencyDescriptor

the descriptor for the target method parameter or field

Returns:boolean

whether the descriptor declares a qualifier, narrowing the candidate status beyond the type match

Annotations
@Override
isAutowireCandidateback to summary
public boolean isAutowireCandidate(BeanDefinitionHolder bdHolder, DependencyDescriptor descriptor)

Overrides default org.springframework.beans.factory.support.AutowireCandidateResolver.isAutowireCandidate.

Doc from org.springframework.beans.factory.support.AutowireCandidateResolver.isAutowireCandidate.

Determine whether the given bean definition qualifies as an autowire candidate for the given dependency.

The default implementation checks org.springframework.beans.factory.config.BeanDefinition#isAutowireCandidate().

Parameters
bdHolder:BeanDefinitionHolder

the bean definition including bean name and aliases

descriptor:DependencyDescriptor

the descriptor for the target method parameter or field

Returns:boolean

whether the bean definition qualifies as autowire candidate

Annotations
@Override
isRequiredback to summary
public boolean isRequired(DependencyDescriptor descriptor)

Overrides default org.springframework.beans.factory.support.AutowireCandidateResolver.isRequired.

Doc from org.springframework.beans.factory.support.AutowireCandidateResolver.isRequired.

Determine whether the given descriptor is effectively required.

The default implementation checks DependencyDescriptor#isRequired().

Parameters
descriptor:DependencyDescriptor

the descriptor for the target method parameter or field

Returns:boolean

whether the descriptor is marked as required or possibly indicating non-required status some other way (e.g. through a parameter annotation)

Annotations
@Override