This commit is contained in:
Keith Donald
2009-09-16 19:25:07 +00:00
parent 1c6965132f
commit 8bf1ee5e7c
2 changed files with 8 additions and 15 deletions

View File

@@ -18,12 +18,7 @@ package org.springframework.core.convert.converter;
/**
* A converter converts a source object of type S to a target of type T.
*
* <p>Implementations of this interface are thread-safe and can be shared.
* Converters are typically registered with and invoked behind a
* {@link org.springframework.core.convert.ConversionService}.
* They typically should not be called directly.
*
* Implementations of this interface are thread-safe and can be shared.
* @author Keith Donald
* @since 3.0
*/
@@ -33,10 +28,8 @@ public interface Converter<S, T> {
* Convert the source of type S to target type T.
* @param source the source object to convert, which must be an instance of S
* @return the converted object, which must be an instance of T
* @throws Exception an exception occurred performing the conversion; may be any checked exception, the conversion
* system will handle wrapping the failure in a {@link org.springframework.core.convert.ConversionException} that provides a consistent type
* conversion error context
* @throws IllegalArgumentException if the source could not be converted
*/
T convert(S source) throws Exception;
T convert(S source);
}

View File

@@ -24,20 +24,20 @@ package org.springframework.core.convert.converter;
public interface ConverterRegistry {
/**
* Add a plain converter to this registry.
* Add a converter to this registry.
*/
void addConverter(Converter<?, ?> converter);
/**
* Add a factory-created converter to this registry.
* Add a ranged converter factory to this registry.
*/
void addConverter(ConverterFactory<?, ?> converterFactory);
void addConverterFactory(ConverterFactory<?, ?> converterFactory);
/**
* Remove the conversion logic from the sourceType to the targetType.
* Remove the conversion logic for the sourceType to the targetType.
* @param sourceType the source type
* @param targetType the target type
*/
void removeConverter(Class<?> sourceType, Class<?> targetType);
void removeConvertible(Class<?> sourceType, Class<?> targetType);
}