public class DomainClassConverter<T extends ConversionService & ConverterRegistry> extends Object implements ConditionalGenericConverter, ApplicationContextAware
Converter to convert arbitrary input into domain classes managed
by Spring Data CrudRepositorys. The implementation uses a ConversionService in turn to convert the
source type into the domain class' id type which is then converted into a domain class object by using a
CrudRepository.GenericConverter.ConvertiblePair| Constructor and Description |
|---|
DomainClassConverter(T conversionService)
Creates a new
DomainClassConverter for the given ConversionService. |
| Modifier and Type | Method and Description |
|---|---|
Object |
convert(Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) |
Set<GenericConverter.ConvertiblePair> |
getConvertibleTypes() |
boolean |
matches(TypeDescriptor sourceType,
TypeDescriptor targetType) |
void |
setApplicationContext(ApplicationContext context) |
public DomainClassConverter(T conversionService)
DomainClassConverter for the given ConversionService.conversionService - must not be null.public Set<GenericConverter.ConvertiblePair> getConvertibleTypes()
getConvertibleTypes in interface GenericConverterpublic Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType)
convert in interface GenericConverterpublic boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType)
matches in interface ConditionalConverterpublic void setApplicationContext(ApplicationContext context)
setApplicationContext in interface ApplicationContextAwareCopyright © 2011-2015–2017 Pivotal Software, Inc.. All rights reserved.