org.springframework.context.annotation

## 类 Jsr330ScopeMetadataResolver

- java.lang.Object
- - org.springframework.context.annotation.Jsr330ScopeMetadataResolver

- 所有已实现的接口:
    ScopeMetadataResolver

      public class Jsr330ScopeMetadataResolver
      extends Object
      implements ScopeMetadataResolver

  Simple `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 Spring's rich default scoping instead - or extend this resolver with custom scoping annotations that point to extended Spring scopes.

  从以下版本开始:
    3.0
  作者:
    Juergen Hoeller
  另请参阅:
    `registerScope(java.lang.Class<?>, java.lang.String)`, `resolveScopeName(java.lang.String)`, `ClassPathBeanDefinitionScanner.setScopeMetadataResolver(org.springframework.context.annotation.ScopeMetadataResolver)`, `AnnotatedBeanDefinitionReader.setScopeMetadataResolver(org.springframework.context.annotation.ScopeMetadataResolver)`

- - ### 构造器概要

    构造器
    构造器和说明
    `Jsr330ScopeMetadataResolver()`

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `registerScope(Class<?> annotationType, String scopeName)` Register an extended JSR-330 scope annotation, mapping it onto a specific Spring scope by name.
    `void` | `registerScope(String annotationType, String scopeName)` Register an extended JSR-330 scope annotation, mapping it onto a specific Spring scope by name.
    `ScopeMetadata` | `resolveScopeMetadata(org.springframework.beans.factory.config.BeanDefinition definition)` Resolve the `ScopeMetadata` appropriate to the supplied bean `definition`.
    `protected String` | `resolveScopeName(String annotationType)` Resolve the given annotation type into a named Spring scope.

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 构造器详细资料

    - #### Jsr330ScopeMetadataResolver

          public Jsr330ScopeMetadataResolver()

  - ### 方法详细资料

    - #### registerScope

          public final void registerScope(Class<?> annotationType,
                                          String scopeName)

      Register an extended JSR-330 scope annotation, mapping it onto a specific Spring scope by name.
      参数:
        `annotationType` - the JSR-330 annotation type as a Class
        `scopeName` - the Spring scope name

    - #### registerScope

          public final void registerScope(String annotationType,
                                          String scopeName)

      Register an extended JSR-330 scope annotation, mapping it onto a specific Spring scope by name.
      参数:
        `annotationType` - the JSR-330 annotation type by name
        `scopeName` - the Spring scope name

    - #### resolveScopeName

          @Nullable
          protected String resolveScopeName(String annotationType)

      Resolve the given annotation type into a named Spring 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 Spring scope name

    - #### resolveScopeMetadata

          public ScopeMetadata resolveScopeMetadata(org.springframework.beans.factory.config.BeanDefinition definition)

      从接口复制的说明: `ScopeMetadataResolver`
      Resolve the `ScopeMetadata` 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` 在接口中 `ScopeMetadataResolver`
      参数:
        `definition` - the target bean definition
      返回:
        the relevant scope metadata; never `null`