Browse Source

polish

pull/23217/head
Keith Donald 17 years ago
parent
commit
8bf1ee5e7c
  1. 13
      org.springframework.core/src/main/java/org/springframework/core/convert/converter/Converter.java
  2. 10
      org.springframework.core/src/main/java/org/springframework/core/convert/converter/ConverterRegistry.java

13
org.springframework.core/src/main/java/org/springframework/core/convert/converter/Converter.java

@ -18,12 +18,7 @@ package org.springframework.core.convert.converter; @@ -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> { @@ -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);
}

10
org.springframework.core/src/main/java/org/springframework/core/convert/converter/ConverterRegistry.java

@ -24,20 +24,20 @@ package org.springframework.core.convert.converter; @@ -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);
}

Loading…
Cancel
Save