Annotation Interface AutoConfiguration
@Target(TYPE)
@Retention(RUNTIME)
@Documented
@Configuration(proxyBeanMethods=false)
@AutoConfigureBefore
@AutoConfigureAfter
public @interface AutoConfiguration
Indicates that a class provides configuration that can be automatically applied by
Spring Boot. Auto-configuration classes are regular
@Configuration
with the exception that
Configuration#proxyBeanMethods() proxyBeanMethods is always false
.
They are located using ImportCandidates
and the SpringFactoriesLoader
mechanism (keyed against EnableAutoConfiguration
).
Generally auto-configuration classes are marked as @Conditional
(most often using @ConditionalOnClass
and
@ConditionalOnMissingBean
annotations).
- Since:
- 2.7.0
- Author:
- Moritz Halbritter
- See Also:
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionClass<?>[]
The auto-configure classes that should have already been applied.String[]
The names of the auto-configure classes that should have already been applied.Class<?>[]
The auto-configure classes that should have not yet been applied.String[]
The names of the auto-configure classes that should have not yet been applied.Explicitly specify the name of the Spring bean definition associated with the@AutoConfiguration
class.
-
Element Details
-
value
Explicitly specify the name of the Spring bean definition associated with the@AutoConfiguration
class. If left unspecified (the common case), a bean name will be automatically generated.The custom name applies only if the
@AutoConfiguration
class is picked up via component scanning or supplied directly to anAnnotationConfigApplicationContext
. If the@AutoConfiguration
class is registered as a traditional XML bean definition, the name/id of the bean element will take precedence.- Returns:
- the explicit component name, if any (or empty String otherwise)
- See Also:
- Default:
- ""
-
before
The auto-configure classes that should have not yet been applied.- Returns:
- the classes
- Default:
- {}
-
beforeName
The names of the auto-configure classes that should have not yet been applied.- Returns:
- the class names
- Default:
- {}
-
after
The auto-configure classes that should have already been applied.- Returns:
- the classes
- Default:
- {}
-
afterName
The names of the auto-configure classes that should have already been applied.- Returns:
- the class names
- Default:
- {}
-