|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.beans.factory.annotation.QualifierAnnotationAutowireCandidateResolver
public class QualifierAnnotationAutowireCandidateResolver
AutowireCandidateResolver
implementation that matches bean definition
qualifiers against qualifier annotations on the field or parameter to be autowired.
AutowireCandidateQualifier
,
Qualifier
Constructor Summary | |
---|---|
QualifierAnnotationAutowireCandidateResolver()
Create a new QualifierAnnotationAutowireCandidateResolver for Spring's standard Qualifier annotation. |
|
QualifierAnnotationAutowireCandidateResolver(Class<? extends Annotation> qualifierType)
Create a new QualifierAnnotationAutowireCandidateResolver for the given qualifier annotation type. |
|
QualifierAnnotationAutowireCandidateResolver(Set<Class<? extends Annotation>> qualifierTypes)
Create a new QualifierAnnotationAutowireCandidateResolver for the given qualifier annotation types. |
Method Summary | |
---|---|
void |
addQualifierType(Class<? extends Annotation> qualifierType)
Register the given type to be used as a qualifier when autowiring. |
boolean |
isAutowireCandidate(BeanDefinitionHolder bdHolder,
DependencyDescriptor descriptor)
Determine if the provided bean definition is an autowire candidate. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public QualifierAnnotationAutowireCandidateResolver()
Qualifier
annotation.
public QualifierAnnotationAutowireCandidateResolver(Class<? extends Annotation> qualifierType)
qualifierType
- the qualifier annotation to look forpublic QualifierAnnotationAutowireCandidateResolver(Set<Class<? extends Annotation>> qualifierTypes)
qualifierTypes
- the qualifier annotations to look forMethod Detail |
---|
public void addQualifierType(Class<? extends Annotation> qualifierType)
This implementation only supports annotations as qualifier types.
qualifierType
- the annotation type to registerpublic boolean isAutowireCandidate(BeanDefinitionHolder bdHolder, DependencyDescriptor descriptor)
To be considered a candidate the bean's autowire-candidate attribute must not have been set to 'false'. Also if an annotation on the field or parameter to be autowired is recognized by this bean factory as a qualifier, the bean must 'match' against the annotation as well as any attributes it may contain. The bean definition must contain the same qualifier or match by meta attributes. A "value" attribute will fallback to match against the bean name or an alias if a qualifier or attribute does not match.
isAutowireCandidate
in interface AutowireCandidateResolver
bdHolder
- the bean definition including bean name and aliasesdescriptor
- the descriptor for the target method parameter or field
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |