spring源码分析之spring-core-io
1. 看一下源码整体结构:

抓住主要点Resource、ResourceLoader和ResourceEditor

其中Resource作用
Interface for a resource descriptor that abstracts from the actual type of underlying resource, such as a file or class path resource.
<p>An InputStream can be opened for every resource if it exists in physical form, but a URL or File handle can just be returned for
certain resources. The actual behavior is implementation-specific.
ResourceLoader的作用
Strategy interface for loading resources (e.. class path or file system resources). An {@link org.springframework.context.ApplicationContext}
is required to provide this functionality, plus extended {@link org.springframework.core.io.support.ResourcePatternResolver} support.
<p>{@link DefaultResourceLoader} is a standalone implementation that is usable outside an ApplicationContext, also used by {@link ResourceEditor}.
<p>Bean properties of type Resource and Resource array can be populated from Strings when running in an ApplicationContext, using the particular context's resource loading strategy.
ResourceEditor作用
{@link java.beans.PropertyEditor Editor} for {@link Resource}descriptors, to automatically convert {@code String} locations e.g. {@code file:C:/myfile.txt} or {@code classpath:myfile.txt} to{@code Resource} properties instead of using a {@code String} location property.<p>The path may contain {@code ${...}} placeholders, to be resolved as {@link org.springframework.core.env.Environment} properties:
e.g. {@code ${user.dir}}. Unresolvable placeholders are ignored by default.<p>Delegates to a {@link ResourceLoader} to do the heavy lifting,
by default using a {@link DefaultResourceLoader}.
spring源码分析之spring-core-io的更多相关文章
- Spring源码分析:Spring IOC容器初始化
概述: Spring 对于Java 开发来说,以及算得上非常基础并且核心的框架了,在有一定开发经验后,阅读源码能更好的提高我们的编码能力并且让我们对其更加理解.俗话说知己知彼,百战不殆.当你对Spri ...
- spring源码分析之spring jmx
JMX架构定义: https://docs.oracle.com/javase/8/docs/technotes/guides/jmx/overview/architecture.html Archi ...
- 【spring源码分析】spring ioc容器之前生今世--DefaultListableBeanFactory源码解读
spring Ioc容器的实现,从根源上是beanfactory,但真正可以作为一个可以独立使用的ioc容器还是DefaultListableBeanFactory,因此可以这么说, DefaultL ...
- spring源码分析之spring注解@Aspect是如何工作的?
1.@Aspect 在xml定义:<aop:aspectj-autoproxy />,其定义在http://www.springframework.org/schema/aop/sprin ...
- 【spring源码分析】spring关于循环依赖的问题
引言:循环依赖就是N个类中循环嵌套引用,如果在日常开发中我们用new 对象的方式发生这种循环依赖的话程序会在运行时一直循环调用,直至内存溢出报错.下面说一下Spring是如果解决循环依赖的. 第一种: ...
- 【spring源码分析】spring和@PostConstruct注解
@PostConstruct注解好多人以为是Spring提供的.其实是Java自己的注解. Java中该注解的说明:@PostConstruct该注解被用来修饰一个非静态的void()方法.被@Pos ...
- 【spring源码分析】spring AspectJ的Execution表达式
在使用spring框架配置AOP的时候,不管是通过XML配置文件还是注解的方式都需要定义pointcut"切入点" 例如定义切入点表达式 execution (* com.sam ...
- Spring源码分析专题——目录
Spring源码分析专题 -- 阅读指引 IOC容器 Spring源码分析专题 -- IOC容器启动过程(上篇) Spring源码分析专题 -- IOC容器启动过程(中篇) Spring源码分析专题 ...
- spring源码分析之spring-core总结篇
1.spring-core概览 spring-core是spring框架的基石,它为spring框架提供了基础的支持. spring-core从源码上看,分为6个package,分别是asm,cgli ...
- Spring源码分析——资源访问利器Resource之实现类分析
今天来分析Spring的资源接口Resource的各个实现类.关于它的接口和抽象类,参见上一篇博文——Spring源码分析——资源访问利器Resource之接口和抽象类分析 一.文件系统资源 File ...
随机推荐
- IIS部署ASP.NET常见错误
今天本地 IIS部署一个.NET Framework 3.5 项目,首先出现一个错误: 静态机制没有办法处理脚本 检查MIME没有问题,检查应用程序池版本,2.0, 果断改成 4.0. 运行之后新错误 ...
- dlmalloc(Android bionic C库的malloc实现)简介
欢迎转载opendevkit文章, 文章原始地址: http://www.opendevkit.com/?e=56 Dlmalloc是目前一个十分流行的内存分配器,其由Doug Lea从1987年开始 ...
- 跟visual studio 集成的git插件
目前有三个,git extension,微软的 visual studio tools for git extension,还有git source control provider 经测试,最好用的 ...
- JDBC数据类型
JDBC数据类型 JDBC驱动程序Java数据类型转换到适当的JDBC类型然后再将它发送到数据库.它使用默认的大多数数据类型映射.例如,一个Java int转换成一个SQL INTEGER.创建默认映 ...
- ArcEngine 无法嵌入互操作类型
说明: 在.net 4.0中,声明 IPoint point = new PointClass();会出现下面这个错误 错误 2 类型"ESRI.ArcGIS.Geometry.PointC ...
- RCP:拖拽功能的实现 Drag and Drop
SWT中的拖拽是使用的org.eclipse.swt.dnd. 有三个需要密切注意的类: 1.DragSource 2.DropTarget 3.Transfer DragSource封装了需要被拖拽 ...
- java 多线程(ReadWriteLock)
package com.example; public class App { public static void main(String[] args) { Info info = new Inf ...
- 远程调试Java程序
java 可以以调试模式启动,启动后可以使用 jdb 对程序进行调试.以调试模式启动,需要加入以下参数: java -Xdebug -Xrunjdwp:transport=dt_socket,addr ...
- [stm32] STM32 Interrupts and events 系统了解(EXTI)及槽型光电开关tp850电路研究
中断和事件 1 嵌套向量中断控制器 特性: ● 68个可屏蔽中断通道(不包含16个Cortex™-M3的中断线):● 16个可编程的优先等级(使用了4位中断优先级):● 低延迟的异常和中断处理:● 电 ...
- Git Day02,工作区,暂存区,回退,删除文件
1st,工作区回退:2st,暂存区回退:3rd,删除文件: