diff --git a/org.springframework.context/src/main/java/org/springframework/context/annotation/ComponentScan.java b/org.springframework.context/src/main/java/org/springframework/context/annotation/ComponentScan.java index c66f540227..2b0b7d011a 100644 --- a/org.springframework.context/src/main/java/org/springframework/context/annotation/ComponentScan.java +++ b/org.springframework.context/src/main/java/org/springframework/context/annotation/ComponentScan.java @@ -26,23 +26,25 @@ import org.springframework.beans.factory.support.BeanNameGenerator; import org.springframework.core.type.filter.TypeFilter; /** - * Configures component scanning directives for use with {@link Configuration @Configuration} - * classes. Provides support parallel with Spring XML's {@code } - * element. + * Configures component scanning directives for use with @{@link Configuration} classes. + * Provides support parallel with Spring XML's {@code } element. * - *

One of {@link #basePackageClasses()}, {@link #basePackages()} or its alias {@link #value()} - * must be specified. + *

One of {@link #basePackageClasses()}, {@link #basePackages()} or its alias + * {@link #value()} must be specified. * - *

Note that the {@code } element has an {@code annotation-config} - * attribute, however this annotation does not. This is because in almost all cases when - * using {@code @ComponentScan}, default annotation config processing (e.g. - * processing {@code @Autowired} and friends) is assumed. Furthermore, when using - * {@link AnnotationConfigApplicationContext}, annotation config processors are always - * registered, meaning that any attempt to disable them at the {@code @ComponentScan} level - * would be ignored. + *

Note that the {@code } element has an + * {@code annotation-config} attribute, however this annotation does not. This is because + * in almost all cases when using {@code @ComponentScan}, default annotation config + * processing (e.g. processing {@code @Autowired} and friends) is assumed. Furthermore, + * when using {@link AnnotationConfigApplicationContext}, annotation config processors are + * always registered, meaning that any attempt to disable them at the + * {@code @ComponentScan} level would be ignored. + * + *

See @{@link Configuration} Javadoc for usage examples. * * @author Chris Beams * @since 3.1 + * @see Configuration */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) diff --git a/org.springframework.context/src/main/java/org/springframework/context/annotation/Configuration.java b/org.springframework.context/src/main/java/org/springframework/context/annotation/Configuration.java index ae6d2e5dfc..12ddd73f4d 100644 --- a/org.springframework.context/src/main/java/org/springframework/context/annotation/Configuration.java +++ b/org.springframework.context/src/main/java/org/springframework/context/annotation/Configuration.java @@ -211,8 +211,8 @@ import org.springframework.stereotype.Component; * } * } * - * See @{@link Profile} and {@link org.springframework.core.env.Environment} Javadoc for - * further details. + * See @{@link Profile} and {@link org.springframework.core.env.Environment Environment} + * Javadoc for further details. * *

With Spring XML using the {@code @ImportResource} annotation

* As mentioned above, {@code @Configuration} classes may be declared as regular Spring @@ -273,10 +273,8 @@ import org.springframework.stereotype.Component; * *

Testing support for {@code @Configuration} classes

* The Spring TestContext framework available in the {@code spring-test} module - * provides the - * {@link org.springframework.test.context.ContextConfiguration @ContextConfiguration} - * annotation, which as of Spring 3.1 can accept an array of {@code @Configuration} - * {@code Class} objects: + * provides the {@code @ContextConfiguration} annotation, which as of Spring 3.1 can + * accept an array of {@code @Configuration} {@code Class} objects: *
  * @RunWith(SpringJUnit4ClassRunner.class)
  * @ContextConfiguration(classes={AppConfig.class, DatabaseConfig.class})
diff --git a/org.springframework.context/src/main/java/org/springframework/context/annotation/Lazy.java b/org.springframework.context/src/main/java/org/springframework/context/annotation/Lazy.java
index 0c0890f2aa..dbce697896 100644
--- a/org.springframework.context/src/main/java/org/springframework/context/annotation/Lazy.java
+++ b/org.springframework.context/src/main/java/org/springframework/context/annotation/Lazy.java
@@ -26,23 +26,22 @@ import java.lang.annotation.Inherited;
 /**
  * Indicates whether a bean is to be lazily initialized.
  *
- * 

May be used on any class directly or indirectly annotated with - * {@link org.springframework.stereotype.Component} or on methods annotated with - * {@link Bean}. + *

May be used on any class directly or indirectly annotated with {@link + * org.springframework.stereotype.Component @Component} or on methods annotated with + * {@link Bean @Bean}. * - *

If this annotation is not present on a Component or Bean definition, eager - * initialization will occur. If present and set to {@code true}, the - * Bean/Component will not be initialized until referenced by another bean or - * explicitly retrieved from the enclosing - * {@link org.springframework.beans.factory.BeanFactory}. If present and set to - * {@code false}, the bean will be instantiated on startup by bean factories - * that perform eager initialization of singletons. + *

If this annotation is not present on a {@code @Component} or {@code @Bean} definition, + * eager initialization will occur. If present and set to {@code true}, the {@code @Bean} or + * {@code @Component} will not be initialized until referenced by another bean or explicitly + * retrieved from the enclosing {@link org.springframework.beans.factory.BeanFactory + * BeanFactory}. If present and set to {@code false}, the bean will be instantiated on + * startup by bean factories that perform eager initialization of singletons. * *

If Lazy is present on a {@link Configuration @Configuration} class, this - * indicates that all {@link Bean @Bean} methods within that {@code @Configuration} - * should be lazily initialized. If Lazy is present and false on a Bean method - * within a Lazy-annotated Configuration class, this indicates overriding the - * 'default lazy' behavior and that the bean should be eagerly initialized. + * indicates that all {@code @Bean} methods within that {@code @Configuration} + * should be lazily initialized. If {@code @Lazy} is present and false on a {@code @Bean} + * method within a {@code @Lazy}-annotated {@code @Configuration} class, this indicates + * overriding the 'default lazy' behavior and that the bean should be eagerly initialized. * * @author Chris Beams * @since 3.0