private static class GenericConversionService.Converters
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.Map<GenericConverter.ConvertiblePair,GenericConversionService.ConvertersForPair> |
converters |
private java.util.Set<GenericConverter> |
globalConverters |
Modifier | Constructor and Description |
---|---|
private |
GenericConversionService.Converters() |
Modifier and Type | Method and Description |
---|---|
void |
add(GenericConverter converter) |
private void |
addToClassHierarchy(int index,
java.lang.Class<?> type,
boolean asArray,
java.util.List<java.lang.Class<?>> hierarchy,
java.util.Set<java.lang.Class<?>> visited) |
GenericConverter |
find(TypeDescriptor sourceType,
TypeDescriptor targetType)
Find a
GenericConverter given a source and target type. |
private java.util.List<java.lang.Class<?>> |
getClassHierarchy(java.lang.Class<?> type)
Returns an ordered class hierarchy for the given type.
|
private java.util.List<java.lang.String> |
getConverterStrings() |
private GenericConversionService.ConvertersForPair |
getMatchableConverters(GenericConverter.ConvertiblePair convertiblePair) |
private GenericConverter |
getRegisteredConverter(TypeDescriptor sourceType,
TypeDescriptor targetType,
GenericConverter.ConvertiblePair convertiblePair) |
void |
remove(java.lang.Class<?> sourceType,
java.lang.Class<?> targetType) |
java.lang.String |
toString() |
private final java.util.Set<GenericConverter> globalConverters
private final java.util.Map<GenericConverter.ConvertiblePair,GenericConversionService.ConvertersForPair> converters
private GenericConversionService.Converters()
public void add(GenericConverter converter)
private GenericConversionService.ConvertersForPair getMatchableConverters(GenericConverter.ConvertiblePair convertiblePair)
public void remove(java.lang.Class<?> sourceType, java.lang.Class<?> targetType)
public GenericConverter find(TypeDescriptor sourceType, TypeDescriptor targetType)
GenericConverter
given 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 typeGenericConverter
, or null
if none foundprivate GenericConverter getRegisteredConverter(TypeDescriptor sourceType, TypeDescriptor targetType, GenericConverter.ConvertiblePair convertiblePair)
private java.util.List<java.lang.Class<?>> getClassHierarchy(java.lang.Class<?> type)
type
- the typeprivate void addToClassHierarchy(int index, java.lang.Class<?> type, boolean asArray, java.util.List<java.lang.Class<?>> hierarchy, java.util.Set<java.lang.Class<?>> visited)
public java.lang.String toString()
toString
in class java.lang.Object
private java.util.List<java.lang.String> getConverterStrings()