From 686705140e5bef1f1a0bb08749154207f40ce898 Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Wed, 4 Jun 2025 14:22:21 +0200 Subject: [PATCH] =?UTF-8?q?Polish=20Javadoc=20for=20@=E2=81=A0Import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../context/annotation/Import.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/context/annotation/Import.java b/spring-context/src/main/java/org/springframework/context/annotation/Import.java index c1275801fc0..60ff80dcae2 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/Import.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/Import.java @@ -29,9 +29,11 @@ import org.springframework.beans.factory.BeanRegistrar; * {@link Configuration @Configuration} classes. * *

Provides functionality equivalent to the {@code } element in Spring XML. - * Allows for importing {@code @Configuration} classes, {@link ImportSelector} and - * {@link ImportBeanDefinitionRegistrar} implementations, as well as regular component - * classes (as of 4.2; analogous to {@link AnnotationConfigApplicationContext#register}). + * + *

Allows for importing {@code @Configuration} classes, {@link ImportSelector}, + * {@link ImportBeanDefinitionRegistrar}, and {@link BeanRegistrar} implementations, + * as well as regular component classes (analogous to + * {@link AnnotationConfigApplicationContext#register}). * *

{@code @Bean} definitions declared in imported {@code @Configuration} classes should be * accessed by using {@link org.springframework.beans.factory.annotation.Autowired @Autowired} @@ -39,7 +41,11 @@ import org.springframework.beans.factory.BeanRegistrar; * declaring the bean can be autowired. The latter approach allows for explicit, IDE-friendly * navigation between {@code @Configuration} class methods. * - *

May be declared at the class level or as a meta-annotation. + *

May be declared directly at the class level or as a meta-annotation. + * {@code @Import} annotations declared directly at the class level are processed + * after {@code @Import} annotations declared as meta-annotations, which allows + * directly declared imports to override beans registered via {@code @Import} + * meta-annotations. * *

If XML or other non-{@code @Configuration} bean definition resources need to be * imported, use the {@link ImportResource @ImportResource} annotation instead. @@ -59,7 +65,7 @@ public @interface Import { /** * {@link Configuration @Configuration}, {@link ImportSelector}, - * {@link ImportBeanDefinitionRegistrar}, {@link BeanRegistrar} or regular + * {@link ImportBeanDefinitionRegistrar}, {@link BeanRegistrar}, or regular * component classes to import. */ Class[] value();