当前位置:网站首页>@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
边栏推荐
- 5 ROS simulation modeling (3-rviz+gazebo+ control simulation robot)
- The difference between abstract classes and interface interfaces
- What has Amazon cloud technology done right to become the leader of cloud AI services for three consecutive years?
- About using NPM command under the terminal, the installation error problem is solved (my own experience)
- uvm_hdl——DPI在UVM中的实现(四)
- [literature reading] - HRL -[hrl with universal policies for multi step robotic control]
- 理解的英文(言语理解)
- [PTA] 7-19 check face value (15 points)
- 每周推荐短视频:需要协同的智能设备越来越多,给物联网开发提出更大挑战?
- Network Security Learning (11) scanning and blasting
猜你喜欢

Network Security Learning (XIII) data link layer

Drive board network cable directly connected to computer shared network configuration

自定义mvc原理

技术美术百人计划学习笔记(2)--向量

Basic knowledge of radar
![[natural language processing] [vector representation] augsbert: improve the data enhancement method of Bi encoders for paired sentence scoring tasks](/img/9a/9bb00abf7804d61d3408143e5e4bda.png)
[natural language processing] [vector representation] augsbert: improve the data enhancement method of Bi encoders for paired sentence scoring tasks
![[paper notes] a meta reinforcement learning algorithm for causal discovery](/img/03/84462b38551c41173f7a9734cb0e99.png)
[paper notes] a meta reinforcement learning algorithm for causal discovery

Learning notes of technical art hundred people plan (2) -- vector

How to obtain the cash flow data of advertising services to help analyze the advertising effect?

Zero crossing position search of discrete data (array)
随机推荐
@Autowired注解 required属性
Zero crossing position search of discrete data (array)
About using NPM command under the terminal, the installation error problem is solved (my own experience)
QT add mouse event to control
The difference between MySQL clustered index and non clustered index
Network security and level protection
[literature reading] - HRL -[hrl with universal policies for multi step robotic control]
WordPress controls the minimum and maximum number of words of article comments
How to set pseudo static for WordPress fixed links
Day 3 experiment
CSV intro
Understanding of forward proxy and reverse proxy
Recommend short videos every week: more and more smart devices need collaboration, posing a greater challenge to the development of the Internet of things?
Notification设置的小图标显示的是小方块
HJ9 提取不重复的整数
Tencent map API request source is not authorized, this request source domain name
General paging function
Memory paging and tuning, kernel and user space
关于优先队列
码蹄集 万民堂大厨