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.
Key for use with the converter cache. |
| private class | |
| private static class | GenericConversionService.
Manages all converters registered with the service. |
| private static class | GenericConversionService.
Manages converters registered with a specific |
| private static class | GenericConversionService.
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. Add a plain converter to this registry. |
| public <S, T> void | addConverter(Class<S> sourceType, Class<T> targetType, Converter<? super S, ? extends T> converter)
Implements org. Add a plain converter to this registry. |
| public void | addConverter(GenericConverter converter)
Implements org. Add a generic converter to this registry. |
| public void | addConverterFactory(ConverterFactory<?, ?> factory)
Implements org. Add a ranged converter factory to this registry. |
| 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. Return |
| 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. Return |
| 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. Convert the given |
| 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. Convert the given |
| 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. Remove any converters from |
| public String |