public class StandardTypeConverter extends java.lang.Object implements TypeConverter
TypeConverter interface,
delegating to a core Spring ConversionService.ConversionService| Constructor and Description |
|---|
StandardTypeConverter() |
StandardTypeConverter(ConversionService conversionService) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canConvert(TypeDescriptor sourceType,
TypeDescriptor targetType)
Return true if the type converter can convert the specified type to the desired target type.
|
java.lang.Object |
convertValue(java.lang.Object value,
TypeDescriptor sourceType,
TypeDescriptor targetType)
Convert (may coerce) a value from one type to another, for example from a boolean to a string.
|
public StandardTypeConverter()
public StandardTypeConverter(ConversionService conversionService)
public boolean canConvert(TypeDescriptor sourceType, TypeDescriptor targetType)
TypeConvertercanConvert in interface TypeConvertersourceType - a type descriptor that describes the source typetargetType - a type descriptor that describes the requested result typepublic java.lang.Object convertValue(java.lang.Object value,
TypeDescriptor sourceType,
TypeDescriptor targetType)
TypeConverterconvertValue in interface TypeConvertervalue - the value to be convertedsourceType - a type descriptor that supplies extra information about the source objecttargetType - a type descriptor that supplies extra information about the requested result type