public class BinderConversionService extends Object implements ConversionService
ConversionService used by the Binder.| Constructor and Description |
|---|
BinderConversionService(ConversionService conversionService)
Create a new
BinderConversionService instance. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canConvert(Class<?> sourceType,
Class<?> targetType) |
boolean |
canConvert(Object source,
ResolvableType targetType)
Return
true if the given source object can be converted to the
targetType. |
boolean |
canConvert(TypeDescriptor sourceType,
TypeDescriptor targetType) |
<T> T |
convert(Object value,
Bindable<T> bindable) |
<T> T |
convert(Object source,
Class<T> targetType) |
<T> T |
convert(Object value,
ResolvableType type) |
Object |
convert(Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) |
public BinderConversionService(ConversionService conversionService)
BinderConversionService instance.conversionService - and option root conversion servicepublic boolean canConvert(Object source, ResolvableType targetType)
true if the given source object can be converted to the
targetType.source - the source objecttargetType - the target type to convert to (required)true if a conversion can be performed, false if notIllegalArgumentException - if targetType is nullpublic boolean canConvert(Class<?> sourceType, Class<?> targetType)
canConvert in interface ConversionServicepublic boolean canConvert(TypeDescriptor sourceType, TypeDescriptor targetType)
canConvert in interface ConversionServicepublic <T> T convert(Object value, ResolvableType type)
public <T> T convert(Object source, Class<T> targetType)
convert in interface ConversionServicepublic Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType)
convert in interface ConversionServiceCopyright © 2017 Pivotal Software, Inc.. All rights reserved.