当前位置:网站首页>@Autowired annotation required attribute
@Autowired annotation required attribute
2022-07-25 23:09:00 【qq_ forty-two million five hundred and eighty-two thousand seve】
stay @Autowired In the annotations , There is one required attribute , The default is true
@Target({
ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Autowired {
/** * Declares whether the annotated dependency is required. * <p>Defaults to {@code true}. */
boolean required() default true;
}
Conclusion :
- When required The attribute is true When , Inject SpringBean When , The bean There must be , Otherwise, the injection will fail , Initiate error reporting
- When required The attribute is false When , Inject SpringBean When , If bean There is , Just inject ; If it doesn't exist , Just ignore skip , No error will be reported during startup , But not directly
边栏推荐
- Understanding English (speech understanding)
- Notification(状态栏通知)详解
- Servlet overview
- The new UI people help task help PHP source code with a value of 1500 / reward task Tiktok Kwai headline like source code / with three-level distribution can be packaged applet
- Memory paging and tuning, kernel and user space
- 关于优先队列
- 理解的英文(言语理解)
- The difference between overloading and rewriting
- Design of Butterworth filter and drawing of amplitude frequency characteristic curve
- Network Security Learning (XV) ARP
猜你喜欢

MathType安装和解决不能Crtl+V的问题

【接口性能优化】索引失效的原因以及如何进行SQL优化

Secure code warrior learning record (IV)

Secure code warrior learning record (III)

赋能合作伙伴,亚马逊云科技如何落地“扶上马,送一程”?

如何获取广告服务流量变现数据,助力广告效果分析?
![[paper notes] a meta reinforcement learning algorithm for causal discovery](/img/03/84462b38551c41173f7a9734cb0e99.png)
[paper notes] a meta reinforcement learning algorithm for causal discovery

AI chief architect 12 AICA industrial landing analysis under the industrial production process optimization scenario

Unity 使用宏

Network Security Learning (XIV) IP protocol
随机推荐
ETL工具(数据同步) 二
Simulink learning notes (III) - Simulink automatic code generation (II) "suggestions collection"
Network Security Learning (XIII) data link layer
Design of regular expressions
通用分页功能
Learning notes of technical art hundred people plan (1) -- basic rendering pipeline
Single model common sense reasoning first surpasses human beings! HFL summit openbookqa challenge
Hj9 extract non duplicate integers
Learning notes of technical art hundred people plan (2) -- vector
[tensorflow] about seed
The difference between "rewrite" and "overload"
About using NPM command under the terminal, the installation error problem is solved (my own experience)
The difference between "= =" and equals
Data filtering of MATLAB
R language drawing parameters (R language plot drawing)
Expression of directional signal -- complex exponential signal
Unity 使用宏
Notification设置的小图标显示的是小方块
SSH服务器CBC加密模式漏洞(CVE-2008-5161)
Wamp MySQL empty password