@Target(value=TYPE) @Retention(value=RUNTIME) @Documented @Configuration(proxyBeanMethods=false) @AutoConfigureBefore @AutoConfigureAfter public @interface AutoConfiguration
@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).
EnableAutoConfiguration
,
AutoConfigureBefore
,
AutoConfigureAfter
,
Conditional
,
ConditionalOnClass
,
ConditionalOnMissingBean
Modifier and Type | Optional Element and Description |
---|---|
Class<?>[] |
after
The auto-configure classes that should have already been applied.
|
String[] |
afterName
The names of the auto-configure classes that should have already been applied.
|
Class<?>[] |
before
The auto-configure classes that should have not yet been applied.
|
String[] |
beforeName
The names of the auto-configure classes that should have not yet been applied.
|
String |
value
Explicitly specify the name of the Spring bean definition associated with the
@AutoConfiguration class. |
@AliasFor(annotation=org.springframework.context.annotation.Configuration.class) public abstract String value
@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
through component scanning or supplied directly to an
AnnotationConfigApplicationContext
. If the @AutoConfiguration
class
is registered as a traditional XML bean definition, the name/id of the bean element
will take precedence.
AnnotationBeanNameGenerator
@AliasFor(annotation=AutoConfigureBefore.class, attribute="value") public abstract Class<?>[] before
@AliasFor(annotation=AutoConfigureBefore.class, attribute="name") public abstract String[] beforeName
@AliasFor(annotation=AutoConfigureAfter.class, attribute="value") public abstract Class<?>[] after
@AliasFor(annotation=AutoConfigureAfter.class, attribute="name") public abstract String[] afterName