org.springframework.context.annotation

## 注释类型 ComponentScan.Filter

-     @Retention(value=RUNTIME)
       @Target(value={})
      public static @interface ComponentScan.Filter

  Declares the type filter to be used as an include filter or exclude filter.

- - ### 可选元素概要

    可选元素
    限定符和类型 | 可选元素和说明
    --- | ---
    `Class<?>[]` | `classes` The class or classes to use as the filter.
    `String[]` | `pattern` The pattern (or patterns) to use for the filter, as an alternative to specifying a Class `value()`.
    `FilterType` | `type` The type of filter to use.
    `Class<?>[]` | `value` Alias for `classes()`.

- - ### 元素详细资料

    - #### type

          public abstract FilterType type

      The type of filter to use.

      Default is `FilterType.ANNOTATION`.

      另请参阅:
        `classes()`, `pattern()`
      默认值:
        org.springframework.context.annotation.FilterType.ANNOTATION

  - - #### value

          @AliasFor(value="classes")
          public abstract Class<?>[] value

      Alias for `classes()`.
      另请参阅:
        `classes()`
      默认值:
        {}

  - - #### classes

          @AliasFor(value="value")
          public abstract Class<?>[] classes

      The class or classes to use as the filter.

      The following table explains how the classes will be interpreted based on the configured value of the `type()` attribute.

      `FilterType` | Class Interpreted As
      --- | ---
      `ANNOTATION` | the annotation itself
      `ASSIGNABLE_TYPE` | the type that detected components should be assignable to
      `CUSTOM` | an implementation of `TypeFilter`

      When multiple classes are specified, OR logic is applied — for example, "include types annotated with `@Foo` OR `@Bar`".

      Custom `TypeFilters` may optionally implement any of the following `Aware` interfaces, and their respective methods will be called prior to `match`:

      - `EnvironmentAware`
      - `BeanFactoryAware`
      - `BeanClassLoaderAware`
      - `ResourceLoaderAware`

      Specifying zero classes is permitted but will have no effect on component scanning.

      从以下版本开始:
        4.2
      另请参阅:
        `value()`, `type()`
      默认值:
        {}

  - - #### pattern

          public abstract String[] pattern

      The pattern (or patterns) to use for the filter, as an alternative to specifying a Class `value()`.

      If `type()` is set to `ASPECTJ`, this is an AspectJ type pattern expression. If `type()` is set to `REGEX`, this is a regex pattern for the fully-qualified class names to match.

      另请参阅:
        `type()`, `classes()`
      默认值:
        {}