类 AnnotationScopeMetadataResolver
- java.lang.Object
- org.springframework.context.annotation.AnnotationScopeMetadataResolver
- 所有已实现的接口:
ScopeMetadataResolver
public class AnnotationScopeMetadataResolver extends Object implements ScopeMetadataResolver
AScopeMetadataResolverimplementation that by default checks for the presence of Spring's@Scopeannotation on the bean class.The exact type of annotation that is checked for is configurable via
setScopeAnnotationType(Class).- 从以下版本开始:
- 2.5
- 作者:
- Mark Fisher, Juergen Hoeller, Sam Brannen
- 另请参阅:
Scope
字段概要
字段 修饰符和类型 字段 说明 protected Class<? extends Annotation>scopeAnnotationType
构造器概要
构造器 构造器 说明 AnnotationScopeMetadataResolver()Construct a newAnnotationScopeMetadataResolver.AnnotationScopeMetadataResolver(ScopedProxyMode defaultProxyMode)Construct a newAnnotationScopeMetadataResolverusing the supplied defaultScopedProxyMode.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 ScopeMetadataresolveScopeMetadata(BeanDefinition definition)Resolve theScopeMetadataappropriate to the supplied beandefinition.voidsetScopeAnnotationType(Class<? extends Annotation> scopeAnnotationType)Set the type of annotation that is checked for by thisAnnotationScopeMetadataResolver.
字段详细资料
scopeAnnotationType
protected Class<? extends Annotation> scopeAnnotationType
构造器详细资料
AnnotationScopeMetadataResolver
public AnnotationScopeMetadataResolver()
Construct a newAnnotationScopeMetadataResolver.
AnnotationScopeMetadataResolver
public AnnotationScopeMetadataResolver(ScopedProxyMode defaultProxyMode)
Construct a newAnnotationScopeMetadataResolverusing the supplied defaultScopedProxyMode.- 参数:
defaultProxyMode- the default scoped-proxy mode
方法详细资料
setScopeAnnotationType
public void setScopeAnnotationType(Class<? extends Annotation> scopeAnnotationType)
Set the type of annotation that is checked for by thisAnnotationScopeMetadataResolver.- 参数:
scopeAnnotationType- the target annotation type
resolveScopeMetadata
public ScopeMetadata resolveScopeMetadata(BeanDefinition definition)
从接口复制的说明:ScopeMetadataResolverResolve theScopeMetadataappropriate to the supplied beandefinition.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 classof the supplieddefinition, or to use metadata present in theAttributeAccessor.attributeNames()of the supplieddefinition.- 指定者:
resolveScopeMetadata在接口中ScopeMetadataResolver- 参数:
definition- the target bean definition- 返回:
- the relevant scope metadata; never
null