ConversionService implementation suitable for use in most environments.
Indirectly implements ConverterRegistry as registration API through the
ConfigurableConversionService interface.
| Modifier and Type | Class and Description |
|---|---|
| private class | |
| private static class | GenericConversionService.ConverterCacheKey
Key for use with the converter cache. |
| private class | |
| private static class | GenericConversionService.Converters
Manages all converters registered with the service. |
| private static class | GenericConversionService.ConvertersForPair
Manages converters registered with a specific |
| private static class | GenericConversionService.NoOpConverter
Internal converter that performs no operation. |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private final GenericConversionService. | |
| private static final GenericConverter | NO_MATCH
Used as a cache entry when no converter is available. |
| private static final GenericConverter | NO_OP_CONVERTER
General NO-OP converter used when conversion is not required. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addConverter(Converter<?, ?> converter)
Implements org. |
| public <S, T> void | addConverter(Class<S> sourceType, Class<T> targetType, Converter<? super S, ? extends T> converter)
Implements org. |
| public void | addConverter(GenericConverter converter)
Implements org. |
| public void | addConverterFactory(ConverterFactory<?, ?> factory)
Implements org. |
| private void | |
| public boolean | Returns: true if conversion can be bypassed; false otherwisecontext about the source type to convert from
(may be sourceType, TypeDescriptor null if source is null)context about the target type to convert to (required) targetType)Return whether conversion between the source type and the target type can be bypassed. |
| public boolean | canConvert(Class<?>
the source type to convert from (may be sourceType, Class<?> null if source is null)the target type to convert to (required) targetType)Implements org. true if objects of sourceType can be converted to the targetType.
|
| public boolean | canConvert(TypeDescriptor
context about the source type to convert from
(may be sourceType, TypeDescriptor null if source is null)context about the target type to convert to (required) targetType)Implements org. true if objects of sourceType can be converted to the targetType.
|
| public <T> T | convert(Object
the source object to convert (may be source, Class<T> null)the target type to convert to (required) targetType)Implements org. source to the specified targetType.
|
| public Object | convert(Object
the source object to convert (may be source, TypeDescriptor null)context about the source type to convert from
(may be sourceType, TypeDescriptor null if source is null)context about the target type to convert to (required) targetType)Implements org. source to the specified targetType.
|
| protected Object | Returns: the converted null objectthe source type to convert from sourceType, TypeDescriptor the target type to convert to targetType)Template method to convert a |
| protected GenericConverter | Returns: the generic converter that will perform the conversion, ornull if no suitable converter was foundthe source type to convert from sourceType, TypeDescriptor the target type to convert to targetType)Hook method to look up the converter for a given sourceType/targetType pair. |
| protected GenericConverter | Returns: the default generic converter that will perform the conversionthe source type to convert from sourceType, TypeDescriptor the target type to convert to targetType)Return the default converter if no converter is found for the given sourceType/targetType pair. |
| private ResolvableType[] | |
| private Object | |
| private Object | |
| private void | |
| public void | removeConvertible(Class<?>
the source type sourceType, Class<?> the target type targetType)Implements org. sourceType to targetType.
|
| public String |