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的更多相关文章

  1. Spring源码分析:Spring IOC容器初始化

    概述: Spring 对于Java 开发来说,以及算得上非常基础并且核心的框架了,在有一定开发经验后,阅读源码能更好的提高我们的编码能力并且让我们对其更加理解.俗话说知己知彼,百战不殆.当你对Spri ...

  2. spring源码分析之spring jmx

    JMX架构定义: https://docs.oracle.com/javase/8/docs/technotes/guides/jmx/overview/architecture.html Archi ...

  3. 【spring源码分析】spring ioc容器之前生今世--DefaultListableBeanFactory源码解读

    spring Ioc容器的实现,从根源上是beanfactory,但真正可以作为一个可以独立使用的ioc容器还是DefaultListableBeanFactory,因此可以这么说, DefaultL ...

  4. spring源码分析之spring注解@Aspect是如何工作的?

    1.@Aspect 在xml定义:<aop:aspectj-autoproxy />,其定义在http://www.springframework.org/schema/aop/sprin ...

  5. 【spring源码分析】spring关于循环依赖的问题

    引言:循环依赖就是N个类中循环嵌套引用,如果在日常开发中我们用new 对象的方式发生这种循环依赖的话程序会在运行时一直循环调用,直至内存溢出报错.下面说一下Spring是如果解决循环依赖的. 第一种: ...

  6. 【spring源码分析】spring和@PostConstruct注解

    @PostConstruct注解好多人以为是Spring提供的.其实是Java自己的注解. Java中该注解的说明:@PostConstruct该注解被用来修饰一个非静态的void()方法.被@Pos ...

  7. 【spring源码分析】spring AspectJ的Execution表达式

    在使用spring框架配置AOP的时候,不管是通过XML配置文件还是注解的方式都需要定义pointcut"切入点" 例如定义切入点表达式  execution (* com.sam ...

  8. Spring源码分析专题——目录

    Spring源码分析专题 -- 阅读指引 IOC容器 Spring源码分析专题 -- IOC容器启动过程(上篇) Spring源码分析专题 -- IOC容器启动过程(中篇) Spring源码分析专题 ...

  9. spring源码分析之spring-core总结篇

    1.spring-core概览 spring-core是spring框架的基石,它为spring框架提供了基础的支持. spring-core从源码上看,分为6个package,分别是asm,cgli ...

  10. Spring源码分析——资源访问利器Resource之实现类分析

    今天来分析Spring的资源接口Resource的各个实现类.关于它的接口和抽象类,参见上一篇博文——Spring源码分析——资源访问利器Resource之接口和抽象类分析 一.文件系统资源 File ...

随机推荐

  1. delphi 屏幕截屏

    function GetScreenAll: TBitmap; // 截取全屏 var C: TCanvas; begin C := TCanvas.Create; result := TBitmap ...

  2. 对于新安装的MySQL如何提升MySQL的安全级别

    一 作为最流行的开源数据库引擎,MySQL本身是非常安全的.即便如此,你仍然需要添加额外的安全层来保护你的MySQL数据库不受攻击,毕竟任何经营网上在线业务的人都不想冒数据库受到损坏的风险.接下来,我 ...

  3. XMPP即时通信(基础)

      使用第三方框架 XMPPFramework   #import "ViewController.h" #import "XMPPFramework.h" @ ...

  4. C++ std::map::erase用法及其陷阱

    1.引入: STL的map中有一个erase方法用来从一个map中删除制定的节点 eg: map<string,string> mapTest; typedef map<string ...

  5. hosts文件的一个小发现

    今天才发现原来同一个ip可以在hosts文件中配置多个域名.之间老是换一个网站就改一下,现在终于不用这么麻烦了 127.0.0.1 gg.pclady.com.cn 127.0.0.1 gg.pcon ...

  6. 我的ORM之五-- 事务

    我的ORM索引 单库事务与分布式事务 单库事务: 性能更好,应用于一个数据库时的场景,当数据库发生变化,如拆分为多个服务器,代码需要修改. 分布式事务:性能相对较差,但有更大的适用场景.当数据库发生变 ...

  7. ENode 1.0 - 事件驱动架构(EDA)思想的在框架中如何体现

    开源地址:https://github.com/tangxuehua/enode 上一篇文章,我给大家分享了我的一个基于DDD以及EDA架构的框架enode,但是只是介绍了一个大概.接下来我准备用很多 ...

  8. iOS——Core Animation 知识摘抄(二)

    阴影 主要是shadowOpacity .shadowColor.shadowOffset和shadowRadius四个属性 shadowPath属性 我们已经知道图层阴影并不总是方的,而是从图层内容 ...

  9. Qt create 配置git版本管理

    配置步骤: git的下载安装.(此时,您应该明白git和github的区别) 如下图1-5,Tool –> Options –> Version Control –> Git –&g ...

  10. Android 数据传递(一) Activity之间的数据传递

    bundle Google Bundle类说明 Bundle类是一个key-value对.Activity之间的数据通信可以通过bundle类来实现数据的存储.即将数据放入bundle里面,将Bund ...