批注接口 ImportAutoConfiguration


@Target(TYPE) @Retention(RUNTIME) @Documented @Inherited @Import(org.springframework.boot.autoconfigure.ImportAutoConfigurationImportSelector.class) public @interface ImportAutoConfiguration
Import and apply the specified auto-configuration classes. Applies the same ordering rules as @EnableAutoConfiguration but restricts the auto-configuration classes to the specified set, rather than consulting ImportCandidates.

Can also be used to exclude() specific auto-configuration classes such that they will never be applied.

Generally, @EnableAutoConfiguration should be used in preference to this annotation, however, @ImportAutoConfiguration can be useful in some situations and especially when writing tests.

从以下版本开始:
1.3.0
作者:
Phillip Webb, Andy Wilkinson
  • 可选元素概要

    可选元素
    修饰符和类型
    可选元素
    说明
    Class<?>[]
    The auto-configuration classes that should be imported.
    Class<?>[]
    Exclude specific auto-configuration classes such that they will never be applied.
    Class<?>[]
    The auto-configuration classes that should be imported.
  • 元素详细资料

    • value

      @AliasFor("classes") Class<?>[] value
      The auto-configuration classes that should be imported. This is an alias for classes().
      返回:
      the classes to import
      默认值:
      {}
    • classes

      @AliasFor("value") Class<?>[] classes
      The auto-configuration classes that should be imported. When empty, the classes are specified using a file in META-INF/spring where the file name is the fully-qualified name of the annotated class, suffixed with .imports. An entry in the file may be prefixed with optional: to indicate that the imported class should be ignored if it is not on the classpath.
      返回:
      the classes to import
      默认值:
      {}
    • exclude

      Class<?>[] exclude
      Exclude specific auto-configuration classes such that they will never be applied.
      返回:
      the classes to exclude
      默认值:
      {}