类 GenericConversionService.Converters
java.lang.Object
cn.taketoday.core.conversion.support.GenericConversionService.Converters
Manages all converters registered with the service.
-
字段概要
字段修饰符和类型字段说明private final ConcurrentHashMap<GenericConverter.ConvertiblePair,GenericConversionService.ConvertersForPair> private final CopyOnWriteArraySet<GenericConverter> -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidadd(GenericConverter converter) private voidaddInterfacesToClassHierarchy(Class<?> type, boolean asArray, List<Class<?>> hierarchy, Set<Class<?>> visited) private voidaddToClassHierarchy(int index, Class<?> type, boolean asArray, List<Class<?>> hierarchy, Set<Class<?>> visited) find(TypeDescriptor sourceType, TypeDescriptor targetType) Find aGenericConvertergiven a source and target type.getClassHierarchy(Class<?> type) Returns an ordered class hierarchy for the given type.getMatchableConverters(GenericConverter.ConvertiblePair convertiblePair) private GenericConvertergetRegisteredConverter(TypeDescriptor sourceType, TypeDescriptor targetType, GenericConverter.ConvertiblePair convertiblePair) voidtoString()
-
字段详细资料
-
globalConverters
-
converters
private final ConcurrentHashMap<GenericConverter.ConvertiblePair,GenericConversionService.ConvertersForPair> converters
-
-
构造器详细资料
-
Converters
private Converters()
-
-
方法详细资料
-
add
-
getMatchableConverters
private GenericConversionService.ConvertersForPair getMatchableConverters(GenericConverter.ConvertiblePair convertiblePair) -
remove
-
find
Find aGenericConvertergiven a source and target type.This method will attempt to match all possible converters by working through the class and interface hierarchy of the types.
- 参数:
sourceType- the source typetargetType- the target type- 返回:
- a matching
GenericConverter, ornullif none found
-
getRegisteredConverter
@Nullable private GenericConverter getRegisteredConverter(TypeDescriptor sourceType, TypeDescriptor targetType, GenericConverter.ConvertiblePair convertiblePair) -
getClassHierarchy
Returns an ordered class hierarchy for the given type.- 参数:
type- the type- 返回:
- an ordered list of all classes that the given type extends or implements
-
addInterfacesToClassHierarchy
-
addToClassHierarchy
-
toString
-
getConverterStrings
-