moved generic converter to spi; added entity converter; removed various service impls in favor of service factory
This commit is contained in:
@@ -20,7 +20,7 @@ import org.springframework.core.convert.ConversionException;
|
||||
import org.springframework.core.convert.ConversionService;
|
||||
import org.springframework.core.convert.ConverterNotFoundException;
|
||||
import org.springframework.core.convert.TypeDescriptor;
|
||||
import org.springframework.core.convert.support.DefaultConversionService;
|
||||
import org.springframework.core.convert.support.ConversionServiceFactory;
|
||||
import org.springframework.expression.EvaluationException;
|
||||
import org.springframework.expression.TypeConverter;
|
||||
import org.springframework.expression.spel.SpelEvaluationException;
|
||||
@@ -40,7 +40,7 @@ public class StandardTypeConverter implements TypeConverter {
|
||||
private final ConversionService conversionService;
|
||||
|
||||
public StandardTypeConverter() {
|
||||
this.conversionService = new DefaultConversionService();
|
||||
this.conversionService = ConversionServiceFactory.createDefault();
|
||||
}
|
||||
|
||||
public StandardTypeConverter(ConversionService conversionService) {
|
||||
|
||||
@@ -23,8 +23,9 @@ import junit.framework.Assert;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.core.convert.ConversionService;
|
||||
import org.springframework.core.convert.TypeDescriptor;
|
||||
import org.springframework.core.convert.support.DefaultConversionService;
|
||||
import org.springframework.core.convert.support.ConversionServiceFactory;
|
||||
import org.springframework.expression.EvaluationException;
|
||||
import org.springframework.expression.Expression;
|
||||
import org.springframework.expression.TypeConverter;
|
||||
@@ -98,7 +99,7 @@ public class ExpressionTestsUsingCoreConversionService extends ExpressionTestCas
|
||||
*/
|
||||
private static class TypeConvertorUsingConversionService implements TypeConverter {
|
||||
|
||||
private final DefaultConversionService service = new DefaultConversionService();
|
||||
private final ConversionService service = ConversionServiceFactory.createDefault();
|
||||
|
||||
public boolean canConvert(Class<?> sourceType, Class<?> targetType) {
|
||||
return this.service.canConvert(sourceType, targetType);
|
||||
|
||||
@@ -20,9 +20,7 @@ import java.util.List;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.core.convert.TypeDescriptor;
|
||||
import org.springframework.core.convert.support.DefaultConversionService;
|
||||
import org.springframework.expression.EvaluationException;
|
||||
import org.springframework.expression.Operation;
|
||||
import org.springframework.expression.OperatorOverloader;
|
||||
@@ -73,7 +71,7 @@ public class StandardComponentsTests {
|
||||
|
||||
@Test
|
||||
public void testStandardTypeConverter() throws EvaluationException {
|
||||
TypeConverter tc = new StandardTypeConverter(new DefaultConversionService());
|
||||
TypeConverter tc = new StandardTypeConverter();
|
||||
tc.convertValue(3, TypeDescriptor.valueOf(Double.class));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user