Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sesemomo
spring-framework
提交
b774147d
S
spring-framework
项目概览
sesemomo
/
spring-framework
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b774147d
编写于
7月 18, 2019
作者:
S
Sam Brannen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polish Javadoc for @Autowired
See gh-23263
上级
817f6895
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
8 addition
and
8 deletion
+8
-8
spring-beans/src/main/java/org/springframework/beans/factory/annotation/Autowired.java
...g/springframework/beans/factory/annotation/Autowired.java
+8
-8
未找到文件。
spring-beans/src/main/java/org/springframework/beans/factory/annotation/Autowired.java
浏览文件 @
b774147d
...
...
@@ -28,11 +28,11 @@ import java.lang.annotation.Target;
* {@link javax.inject.Inject} annotation, adding required-vs-optional semantics.
*
* <h3>Autowired Constructors</h3>
* <p>Only one constructor of any given bean class may declare this annotation with
*
the 'required'
attribute set to {@code true}, indicating <i>the</i> constructor
* to autowire when used as a Spring bean. Furthermore, if the
'required' attribute
*
is set to {@code true}, only a single constructor may be annotated with
* {@code @Autowired}. If multiple <i>non-required</i> constructors declare the
* <p>Only one constructor of any given bean class may declare this annotation with
the
*
{@link #required}
attribute set to {@code true}, indicating <i>the</i> constructor
* to autowire when used as a Spring bean. Furthermore, if the
{@code required}
*
attribute is set to {@code true}, only a single constructor may be annotated
*
with
{@code @Autowired}. If multiple <i>non-required</i> constructors declare the
* annotation, they will be considered as candidates for autowiring. The constructor
* with the greatest number of dependencies that can be satisfied by matching beans
* in the Spring container will be chosen. If none of the candidates can be satisfied,
...
...
@@ -60,10 +60,10 @@ import java.lang.annotation.Target;
* reference documentation for details).
*
* <h3>Multiple Arguments and 'required' Semantics</h3>
* <p>In the case of a multi-arg constructor or method, the
'required' parameter is
* applicable to all arguments. Individual parameters may be declared as Java-8 style
* <p>In the case of a multi-arg constructor or method, the
{@link #required} attribute
*
is
applicable to all arguments. Individual parameters may be declared as Java-8 style
* {@link java.util.Optional} or, as of Spring Framework 5.0, also as {@code @Nullable}
* or a not-null parameter type in Kotlin, overriding the base
required
semantics.
* or a not-null parameter type in Kotlin, overriding the base
'required'
semantics.
*
* <h3>Autowiring Arrays, Collections, and Maps</h3>
* <p>In case of an array, {@link java.util.Collection}, or {@link java.util.Map}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录