public class AnnotationScopeMetadataResolver extends Object implements ScopeMetadataResolver
ScopeMetadataResolver implementation that by default checks for
the presence of Spring's @Scope annotation on the bean class.
The exact type of annotation that is checked for is configurable via
setScopeAnnotationType(Class).
Scope| 限定符和类型 | 字段和说明 |
|---|---|
protected Class<? extends Annotation> |
scopeAnnotationType |
| 构造器和说明 |
|---|
AnnotationScopeMetadataResolver()
Construct a new
AnnotationScopeMetadataResolver. |
AnnotationScopeMetadataResolver(ScopedProxyMode defaultProxyMode)
Construct a new
AnnotationScopeMetadataResolver using the
supplied default ScopedProxyMode. |
| 限定符和类型 | 方法和说明 |
|---|---|
ScopeMetadata |
resolveScopeMetadata(org.springframework.beans.factory.config.BeanDefinition definition)
Resolve the
ScopeMetadata appropriate to the supplied
bean definition. |
void |
setScopeAnnotationType(Class<? extends Annotation> scopeAnnotationType)
Set the type of annotation that is checked for by this
AnnotationScopeMetadataResolver. |
protected Class<? extends Annotation> scopeAnnotationType
public AnnotationScopeMetadataResolver()
AnnotationScopeMetadataResolver.public AnnotationScopeMetadataResolver(ScopedProxyMode defaultProxyMode)
AnnotationScopeMetadataResolver using the
supplied default ScopedProxyMode.defaultProxyMode - the default scoped-proxy modepublic void setScopeAnnotationType(Class<? extends Annotation> scopeAnnotationType)
AnnotationScopeMetadataResolver.scopeAnnotationType - the target annotation typepublic ScopeMetadata resolveScopeMetadata(org.springframework.beans.factory.config.BeanDefinition definition)
ScopeMetadataResolverScopeMetadata appropriate to the supplied
bean definition.
Implementations can of course use any strategy they like to
determine the scope metadata, but some implementations that spring
immediately to mind might be to use source level annotations
present on the class of the
supplied definition, or to use metadata present in the
AttributeAccessor.attributeNames() of the supplied definition.
resolveScopeMetadata 在接口中 ScopeMetadataResolverdefinition - the target bean definitionnull