public class DomainClassConverter<T extends ConversionService & ConverterRegistry> extends Object implements ConditionalGenericConverter, ApplicationContextAware
Converter
to convert arbitrary input into domain classes managed
by Spring Data CrudRepository
s. 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) |
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)
public Set<GenericConverter.ConvertiblePair> getConvertibleTypes()
getConvertibleTypes
in interface GenericConverter
public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType)
convert
in interface GenericConverter
public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType)
matches
in interface ConditionalGenericConverter
public void setApplicationContext(ApplicationContext context)
setApplicationContext
in interface ApplicationContextAware
Copyright © 2011-2013-2014 Pivotal. All Rights Reserved.