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 |
private static java.util.Set<java.lang.Class<?>> |
IGNORED_CLASSES |
Modifier | Constructor and Description |
---|---|
private |
GenericConversionService.Converters() |
Modifier and Type | Method and Description |
---|---|
void |
add(GenericConverter converter) |
private void |
collectTypeHierarchy(java.util.Set<TypeDescriptor> typeHierarchy,
TypeDescriptor type) |
private TypeDescriptor |
createRelated(TypeDescriptor type,
java.lang.Class<?> relatedType) |
GenericConverter |
find(TypeDescriptor sourceType,
TypeDescriptor targetType)
Find a
GenericConverter given a source and target type. |
private java.util.List<java.lang.String> |
getConverterStrings() |
private GenericConversionService.ConvertersForPair |
getMatchableConverters(GenericConverter.ConvertiblePair convertiblePair) |
private GenericConverter |
getRegisteredConverter(TypeDescriptor sourceType,
TypeDescriptor targetType,
TypeDescriptor sourceCandidate,
TypeDescriptor targetCandidate) |
private java.util.List<TypeDescriptor> |
getTypeHierarchy(TypeDescriptor type)
Returns an ordered class hierarchy for the given type.
|
void |
remove(java.lang.Class<?> sourceType,
java.lang.Class<?> targetType) |
java.lang.String |
toString() |
private static final java.util.Set<java.lang.Class<?>> IGNORED_CLASSES
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 though the class and interface
hierarchy of the types.sourceType
- the source typetargetType
- the target typeGenericConverter
or null#getTypeHierarchy(Class)
private GenericConverter getRegisteredConverter(TypeDescriptor sourceType, TypeDescriptor targetType, TypeDescriptor sourceCandidate, TypeDescriptor targetCandidate)
private java.util.List<TypeDescriptor> getTypeHierarchy(TypeDescriptor type)
type
- the typeprivate void collectTypeHierarchy(java.util.Set<TypeDescriptor> typeHierarchy, TypeDescriptor type)
private TypeDescriptor createRelated(TypeDescriptor type, java.lang.Class<?> relatedType)
public java.lang.String toString()
toString
in class java.lang.Object
private java.util.List<java.lang.String> getConverterStrings()