自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(15)
  • 收藏
  • 关注

原创 一文教会你如何让spring @PropertySource支持读取yaml文件

一文教会你如何让spring @PropertySource支持读取yaml文件背景介绍实现思路具体实现使用演示进阶思考使用演示背景介绍通过之前的文章(点击查看)我们已经知道@PropertySource默认支持读取properties文件和xml文件,如果我们想让@PropertySource支持yaml文件的话,需要编写自定义factory。今天我们就来编写一个自定义的factory来实现这个功能。实现思路public class DefaultPropertySourceFactory imp

2021-07-01 09:57:26 499

原创 spring-context注解源码系列(十一)——@Scope

@TOC注解说明When used as a type-level annotation in conjunction with {@link org.springframework.stereotype.Component @Component}, {@code @Scope} indicates the name of a scope to use for instances of the annotated type.当和@Component一同使用,可以指定Bean的作用域。@Scope默认

2021-06-30 11:56:42 169

原创 spring-context注解源码系列十——@PropertySource

spring-context注解源码系列十——@PropertySource注解说明属性说明使用示例相关源码ConfigurationClassParser注解说明Annotation providing a convenient and declarative mechanism for adding a {@link org.springframework.core.env.PropertySource PropertySource} to Spring’s {@link org.springfra

2021-06-30 10:30:38 157

原创 spring-context注解源码系列九——@Primary

spring-context注解源码系列九——@Primary注解说明使用示例相关源码AnnotationConfigUtilsDefaultListableBeanFactory注解说明Indicates that a bean should be given preference when multiple candidates are qualified to autowire a single-valued dependency. If exactly one ‘primary’ bean ex

2021-06-29 14:18:42 144

原创 spring-context注解源码系列八——@Iazy

spring-context注解源码系列八——@Iazy注解说明属性说明使用示例延迟加载延迟注入相关源码延迟加载AnnotationConfigUtilsAbstractBeanFactory延迟注入CommonAnnotationBeanPostProcessor注解说明Indicates whether a bean is to be lazily initialized.指定一个Bean是否要延迟加载。@Lazy注解,除了指定一个Bean是否要延迟加载这个功能以外,它还可以和@Resource

2021-06-28 13:15:23 93

原创 spring-context注解源码系列七——@ImportResource

spring-context注解源码系列七——@ImportResource注解说明ImportResource和Import区别:属性说明使用示例相关源码ConfigurationClassParserConfigurationClassBeanDefinitionReader注解说明Indicates one or more resources containing bean definitions to import.指定导入一个或者多个包含了 BeanDefinition 的文件。Impor

2021-06-28 09:40:37 277

原创 Java杂谈之重写equals方法

Java杂谈之重写equals方法什么是equals方法Object中的equals方法的源码为什么需要重写equals方法重写equals方法需要遵守的规范什么是equals方法Java中用equals方法来判断两个对象是不是相等,equals方法是Object类就拥有的方法,因此所有类都拥有该方法,使用方式很简单:a.equals(b) ,返回true或false。Object中的equals方法的源码 public boolean equals(Object obj) { r

2021-06-27 20:42:33 105

原创 深入学习Redis5(一):Redis简单介绍

Redis简介Redis(REmote DIctionary Server)是一个使用ANSI C编写的、开源的、支持网络的、基于内存的、可选持久化的键值对存储系统。Redis支持五种基本数据类型:string,hash,list,set和zset(sorted set),同时支持四种特殊基本类型:bitMap,geospatial,hyperLogLog和streams。Redis特点1.Redis是内存型的数据库,响应非常快,每秒可以执行大约 110 000 个写入操作,或者 81 000 个

2021-06-25 16:44:37 172

原创 spring-context注解系列六——@Import

spring-context注解系列六——@Import注解说明属性说明使用示例相关源码ConfigurationClassParser注解说明Indicates one or more component classes to import ; typically {@link Configuration @Configuration} classes.指定一个或者多个需要导入组件类,通常作用于配置类属性说明 /** * 需要被导入类的集合 */ Class<?>[] va

2021-06-25 09:41:28 141

原创 Java中的移位运算符<<、>>、>>>

Java中的移位运算符<<、>>、>>>java中有三种移位运算符左移符号:<<右移符号:>>无符号右移:>>>示例代码输出结果java中有三种移位运算符左移符号:<<将二进制向左移动1位,最右边用0填补,效果等于1个数乘以2。右移符号:>>将二进制向右移动1位,最左边用符号位填补(即原来的最左边那位),效果等于1个数除以2无符号右移:>>>将二进制向右移动1位,最左边

2021-06-23 09:30:32 189

原创 spring-context注解系列五——@DependsOn

spring-context注解系列五——@DependsOn注解说明属性说明使用示例相关源码AnnotationConfigUtilsAbstractBeanFactory注解说明Beans on which the current bean depends. Any beans specified are guaranteed to be created by the container before this bean. Used infrequently in cases where a bea

2021-06-22 13:30:40 567

原创 spring-context注解系列四——@Configuration

spring-context注解系列三——@Configuration注解说明full模式:lite模式属性说明使用示例相关源码ConditionEvaluator注解说明Indicates that a class declares one or more {@link Bean @Bean} methods and may be processed by the Spring container to generate bean definitions and service requests fo

2021-06-18 09:13:41 258

原创 spring-context注解系列三——@Conditional

spring-context注解系列三——@Conditional注解说明属性说明使用示例相关源码ConditionEvaluator注解说明Indicates that a component is only eligible for registration when all {@linkplain #value specified conditions} match.一个组件只有满足所有条件的时候才会被创建属性说明 /** * 实现Condition接口的类的数组,当所有Conditio

2021-06-09 18:43:38 117

原创 spring-context注解系列二——@ComponentScan、ComponentScans

spring-context注解系列二——@ComponentScan、ComponentScans注解说明属性说明使用示例相关源码ConfigurationClassParserConfigurationClassParserComponentScanAnnotationParser注解说明Configures component scanning directives for use with @{@link Configuration} classes.加载配置类上面,用于指定扫描信息的类。属

2021-06-08 16:31:20 110

原创 spring-context注解系列一——@Bean

spring-context注解系列一——@Bean源码说明使用示例相关源码ConfigurationClassParserConfigurationClassBeanDefinitionReader源码说明Indicates that a method produces a bean to be managed by the Spring container.指定一个方法生成一个bean交给spring容器进行管理。使用示例@Beanpublic MyBean myBean() { // i

2021-06-03 09:35:18 134

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除