注释类型 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 spring.factories.

    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
    • 可选元素概要

      可选元素 
      修饰符和类型可选元素说明
      Class<?>[]classes
      The auto-configuration classes that should be imported.
      Class<?>[]exclude
      Exclude specific auto-configuration classes such that they will never be applied.
      Class<?>[]value
      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 an entry in META-INF/spring.factories where the key is the fully-qualified name of the annotated class.
        返回:
        the classes to import
        默认值:
        {}
      • exclude

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