public class DomainClassConverter<T extends org.springframework.core.convert.ConversionService & org.springframework.core.convert.converter.ConverterRegistry> extends Object implements org.springframework.core.convert.converter.ConditionalGenericConverter, org.springframework.context.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
.Constructor and Description |
---|
DomainClassConverter(T conversionService)
Creates a new
DomainClassConverter for the given ConversionService . |
Modifier and Type | Method and Description |
---|---|
Object |
convert(Object source,
org.springframework.core.convert.TypeDescriptor sourceType,
org.springframework.core.convert.TypeDescriptor targetType) |
Set<org.springframework.core.convert.converter.GenericConverter.ConvertiblePair> |
getConvertibleTypes() |
boolean |
matches(org.springframework.core.convert.TypeDescriptor sourceType,
org.springframework.core.convert.TypeDescriptor targetType) |
void |
setApplicationContext(org.springframework.context.ApplicationContext context) |
public DomainClassConverter(T conversionService)
DomainClassConverter
for the given ConversionService
.conversionService
- must not be null.public Set<org.springframework.core.convert.converter.GenericConverter.ConvertiblePair> getConvertibleTypes()
getConvertibleTypes
in interface org.springframework.core.convert.converter.GenericConverter
public Object convert(Object source, org.springframework.core.convert.TypeDescriptor sourceType, org.springframework.core.convert.TypeDescriptor targetType)
convert
in interface org.springframework.core.convert.converter.GenericConverter
public boolean matches(org.springframework.core.convert.TypeDescriptor sourceType, org.springframework.core.convert.TypeDescriptor targetType)
matches
in interface org.springframework.core.convert.converter.ConditionalConverter
public void setApplicationContext(org.springframework.context.ApplicationContext context)
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
Copyright © 2011–2017 Pivotal Software, Inc.. All rights reserved.