Skip to content

Commit b774147

Browse files
committed
Polish Javadoc for @Autowired
See gh-23263
1 parent 817f689 commit b774147

File tree

1 file changed

+8
-8
lines changed
  • spring-beans/src/main/java/org/springframework/beans/factory/annotation

1 file changed

+8
-8
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/annotation/Autowired.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
* {@link javax.inject.Inject} annotation, adding required-vs-optional semantics.
2929
*
3030
* <h3>Autowired Constructors</h3>
31-
* <p>Only one constructor of any given bean class may declare this annotation with
32-
* the 'required' attribute set to {@code true}, indicating <i>the</i> constructor
33-
* to autowire when used as a Spring bean. Furthermore, if the 'required' attribute
34-
* is set to {@code true}, only a single constructor may be annotated with
35-
* {@code @Autowired}. If multiple <i>non-required</i> constructors declare the
31+
* <p>Only one constructor of any given bean class may declare this annotation with the
32+
* {@link #required} attribute set to {@code true}, indicating <i>the</i> constructor
33+
* to autowire when used as a Spring bean. Furthermore, if the {@code required}
34+
* attribute is set to {@code true}, only a single constructor may be annotated
35+
* with {@code @Autowired}. If multiple <i>non-required</i> constructors declare the
3636
* annotation, they will be considered as candidates for autowiring. The constructor
3737
* with the greatest number of dependencies that can be satisfied by matching beans
3838
* in the Spring container will be chosen. If none of the candidates can be satisfied,
@@ -60,10 +60,10 @@
6060
* reference documentation for details).
6161
*
6262
* <h3>Multiple Arguments and 'required' Semantics</h3>
63-
* <p>In the case of a multi-arg constructor or method, the 'required' parameter is
64-
* applicable to all arguments. Individual parameters may be declared as Java-8 style
63+
* <p>In the case of a multi-arg constructor or method, the {@link #required} attribute
64+
* is applicable to all arguments. Individual parameters may be declared as Java-8 style
6565
* {@link java.util.Optional} or, as of Spring Framework 5.0, also as {@code @Nullable}
66-
* or a not-null parameter type in Kotlin, overriding the base required semantics.
66+
* or a not-null parameter type in Kotlin, overriding the base 'required' semantics.
6767
*
6868
* <h3>Autowiring Arrays, Collections, and Maps</h3>
6969
* <p>In case of an array, {@link java.util.Collection}, or {@link java.util.Map}

0 commit comments

Comments
 (0)