Skip to content

Commit e8f8559

Browse files
committed
Improve documentation of @bean 'lite' mode
Removed misleading mention of "configuration classes" in the "@bean Lite Mode" section. Issue: SPR-9401
1 parent 94c9f96 commit e8f8559

File tree

1 file changed

+9
-10
lines changed
  • spring-context/src/main/java/org/springframework/context/annotation

1 file changed

+9
-10
lines changed

spring-context/src/main/java/org/springframework/context/annotation/Bean.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,15 @@
103103
* <p>{@code @Bean} methods may also be declared within classes that are <em>not</em>
104104
* annotated with {@code @Configuration}. For example, bean methods may be declared
105105
* in a {@code @Component} class or even in a <em>plain old class</em>. In such cases,
106-
* a {@code @Bean} method will get processed in a configuration class <em>'lite'</em>
107-
* mode.
108-
*
109-
* <p>In contrast to bean methods in {@code @Configuration} classes as described
110-
* above, bean methods in <em>lite</em> mode will be called as plain <em>factory
111-
* methods</em> from the container (similar to {@code factory-method} declarations
112-
* in XML) but with <b><em>prototype</em></b> semantics. The containing class remains
113-
* unmodified in this case, and there are no unusual constraints for factory methods;
114-
* however, scoping semantics are <b>not</b> respected as described above for
115-
* 'inter-bean method invocations in this mode. For example:
106+
* a {@code @Bean} method will get processed in a so-called <em>'lite'</em> mode.
107+
*
108+
* <p>In contrast to the semantics for bean methods in {@code @Configuration} classes
109+
* as described above, bean methods in <em>lite</em> mode will be called as plain
110+
* <em>factory methods</em> from the container (similar to {@code factory-method}
111+
* declarations in XML) but with <b><em>prototype</em></b> semantics. The containing
112+
* class remains unmodified in this case, and there are no unusual constraints for
113+
* factory methods; however, scoping semantics are <b>not</b> respected as described
114+
* above for 'inter-bean method' invocations in this mode. For example:
116115
*
117116
* <pre class="code">
118117
* &#064;Component

0 commit comments

Comments
 (0)