类 Jsr330ScopeMetadataResolver
- 所有已实现的接口:
ScopeMetadataResolver
ScopeMetadataResolver implementation that follows JSR-330 scoping rules:
defaulting to prototype scope unless Singleton is present.
This scope resolver can be used with ClassPathBeanDefinitionScanner and
AnnotatedBeanDefinitionReader for standard JSR-330 compliance. However,
in practice, you will typically use Framework's rich default scoping instead - or extend
this resolver with custom scoping annotations that point to extended Framework scopes.
- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明final voidregisterScope(Class<?> annotationType, String scopeName) Register an extended JSR-330 scope annotation, mapping it onto a specific Frameworkscope by name.final voidregisterScope(String annotationType, String scopeName) Register an extended JSR-330 scope annotation, mapping it onto a specific Framework scope by name.resolveScopeMetadata(BeanDefinition definition) Resolve theScopeMetadataappropriate to the supplied beandefinition.protected StringresolveScopeName(String annotationType) Resolve the given annotation type into a named Framework scope.
-
构造器详细资料
-
Jsr330ScopeMetadataResolver
public Jsr330ScopeMetadataResolver()
-
-
方法详细资料
-
registerScope
Register an extended JSR-330 scope annotation, mapping it onto a specific Frameworkscope by name.- 参数:
annotationType- the JSR-330 annotation type as a ClassscopeName- the Framework scope name
-
registerScope
Register an extended JSR-330 scope annotation, mapping it onto a specific Framework scope by name.- 参数:
annotationType- the JSR-330 annotation type by namescopeName- the Framework scope name
-
resolveScopeName
Resolve the given annotation type into a named Framework scope.The default implementation simply checks against registered scopes. Can be overridden for custom mapping rules, e.g. naming conventions.
- 参数:
annotationType- the JSR-330 annotation type- 返回:
- the Framework scope name
-
resolveScopeMetadata
从接口复制的说明:ScopeMetadataResolverResolve theScopeMetadataappropriate to the supplied beandefinition.Implementations can of course use any strategy they like to determine the scope metadata, but some implementations that immediately to mind might be to use source level annotations present on
the classof the supplieddefinition, or to use metadata present in theAttributeAccessor.getAttributeNames()of the supplieddefinition.- 指定者:
resolveScopeMetadata在接口中ScopeMetadataResolver- 参数:
definition- the target bean definition- 返回:
- the relevant scope metadata; never
null
-