Skip to content

Commit df15b64

Browse files
committed
Document @Autowired support on parameters
Closes gh-21118
1 parent e1080f8 commit df15b64

File tree

1 file changed

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

1 file changed

+9
-0
lines changed

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

+9
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@
4848
* Bean property setter methods are effectively just a special case of such a general
4949
* config method. Such config methods do not have to be public.
5050
*
51+
* <h3>Autowired Parameters</h3>
52+
* <p>Although {@code @Autowired} can technically be declared on individual method
53+
* or constructor parameters since Spring Framework 5.0, most parts of the
54+
* framework ignore such declarations. The only part of the core Spring Framework
55+
* that actively supports autowired parameters is the JUnit Jupiter support in
56+
* the {@code spring-test} module (see the
57+
* <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/testing.html#testcontext-junit-jupiter-di">TestContext framework</a>
58+
* reference documentation for details).
59+
*
5160
* <h3>Multiple Arguments and 'required' Semantics</h3>
5261
* <p>In the case of a multi-arg constructor or method, the 'required' parameter is
5362
* applicable to all arguments. Individual parameters may be declared as Java-8 style

0 commit comments

Comments
 (0)