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.@Nonnull public Set<GenericConverter.ConvertiblePair> getConvertibleTypes()
getConvertibleTypes in interface GenericConverter@Nullable public Object convert(@Nullable 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–2021 Pivotal Software, Inc.. All rights reserved.