diff --git a/org.springframework.core/src/main/java/org/springframework/core/convert/converter/Converter.java b/org.springframework.core/src/main/java/org/springframework/core/convert/converter/Converter.java index f38a0fd7b06..5430723c324 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/convert/converter/Converter.java +++ b/org.springframework.core/src/main/java/org/springframework/core/convert/converter/Converter.java @@ -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. - * - *
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 {
* 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);
}
diff --git a/org.springframework.core/src/main/java/org/springframework/core/convert/converter/ConverterRegistry.java b/org.springframework.core/src/main/java/org/springframework/core/convert/converter/ConverterRegistry.java
index 6e370f56231..8a8bee8014e 100644
--- a/org.springframework.core/src/main/java/org/springframework/core/convert/converter/ConverterRegistry.java
+++ b/org.springframework.core/src/main/java/org/springframework/core/convert/converter/ConverterRegistry.java
@@ -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);
}