1 Star 0 Fork 156

chenym / Spring-Analysis

forked from 蓝色调调 / Spring-Analysis 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Spring-GenericConverter.md 801 Bytes
一键复制 编辑 原始数据 按行查看 历史
huifer 提交于 2020-11-09 16:53 . :fire:core/ convert + attributeAccessor

Spring GenericConverter

  • 类全路径: org.springframework.core.convert.converter.GenericConverter
  • 类图 GenericConverter

public interface GenericConverter {

	/**
	 * 返回对象 ConvertiblePair , ConvertiblePair 中包含了 原类型和目标类型
	 */
	@Nullable
	Set<ConvertiblePair> getConvertibleTypes();

	/**
	 * 类型转换
	 */
	@Nullable
	Object convert(@Nullable Object source, TypeDescriptor sourceType, TypeDescriptor targetType);

}

ConvertiblePair

  • 类全路径: org.springframework.core.convert.converter.GenericConverter.ConvertiblePair
	final class ConvertiblePair {
		/**
		 * 原类型
		 */
		private final Class<?> sourceType;

		/**
		 * 目标类型
		 */
		private final Class<?> targetType;
}
Java
1
https://gitee.com/chenym1202/spring-analysis.git
git@gitee.com:chenym1202/spring-analysis.git
chenym1202
spring-analysis
Spring-Analysis
master

搜索帮助