![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
注解
以后养只狗
偶尔会写点博客分享一下心得,希望和众多程序员小伙伴一起成长,相互帮助、
展开
-
自定义注解的小栗子
1、自定义注解 /** * 自定义注解 * * @author guo */ @Target({ElementType.FIELD,ElementType.TYPE}) // 注解目标类型 @Retention(RetentionPolicy.RUNTIME) // 运行机制 @Inherited // 允许子类继承 @Documented public @interface MyAn...原创 2020-04-08 17:27:37 · 107 阅读 · 0 评论 -
SpringBoot注解之@PropertySource
@PropertySource注解用来引入配置文件 @Configuration @PropertySource(value = "classpath:my-app.properties") public class NettyConfiguration { @Value("${tms.port}") private int tmsPort; @Value("${boss.thre...原创 2019-11-27 14:50:36 · 130 阅读 · 0 评论 -
Spring的注解@Qualifier作用
举个栗子:同一个接口被多个类实现 @Service("ServiceImpl1") public class ServiceImpl1 implements ServiceDemo{ } @Service("ServiceImpl2") public class ServiceImpl2 implements ServiceDemo{ } 在@Autowired注入时,用@Qualfi...原创 2019-11-27 14:11:01 · 1325 阅读 · 0 评论