Top Description Methods
org.springframework.core.convert.converter

public Interface ConverterRegistry

Known Direct Subinterfaces
org.springframework.core.convert.support.ConfigurableConversionService

For registering converters with a type conversion system.
Authors
Keith Donald, Juergen Hoeller
Since
3.0

Method Summary

Modifier and TypeMethod and Description
public void
addConverter(Converter<?, ?> converter)

Add a plain converter to this registry.

public <S, T> void
addConverter(Class<S> sourceType, Class<T> targetType, Converter<? super S, ? extends T> converter)

Add a plain converter to this registry.

public void
addConverter(GenericConverter converter)

Add a generic converter to this registry.

public void
addConverterFactory(ConverterFactory<?, ?> factory)

Add a ranged converter factory to this registry.

public void
removeConvertible(Class<?>
the source type
sourceType
,
Class<?>
the target type
targetType
)

Remove any converters from sourceType to targetType.

Method Detail

addConverterback to summary
public void addConverter(Converter<?, ?> converter)

Add a plain converter to this registry. The convertible source/target type pair is derived from the Converter's parameterized types.

Exceptions
IllegalArgumentException:
if the parameterized types could not be resolved
addConverterback to summary
public <S, T> void addConverter(Class<S> sourceType, Class<T> targetType, Converter<? super S, ? extends T> converter)

Add a plain converter to this registry. The convertible source/target type pair is specified explicitly.

Allows for a Converter to be reused for multiple distinct pairs without having to create a Converter class for each pair.

Since
3.1
addConverterback to summary
public void addConverter(GenericConverter converter)

Add a generic converter to this registry.

addConverterFactoryback to summary
public void addConverterFactory(ConverterFactory<?, ?> factory)

Add a ranged converter factory to this registry. The convertible source/target type pair is derived from the ConverterFactory's parameterized types.

Exceptions
IllegalArgumentException:
if the parameterized types could not be resolved
removeConvertibleback to summary
public void removeConvertible(Class<?> sourceType, Class<?> targetType)

Remove any converters from sourceType to targetType.

Parameters
sourceType:Class<?>

the source type

targetType:Class<?>

the target type