S - D - public interface Converter<S,D> extends MappedTypePair<S,D>
convert method for cases where you only want to control a
specific portion of the mapping, but wish to delegate some or all of the
mapping of the nested types. CustomConverter for a base class which can
be extended to create your own custom converter instance.| Modifier and Type | Method and Description |
|---|---|
boolean |
canConvert(Type<?> sourceType,
Type<?> destinationType)
Answers whether this converter can be used to handle the conversion of
sourceType to destinationType. |
D |
convert(S source,
Type<? extends D> destinationType,
MappingContext mappingContext)
Perform the conversion of
source into a new instance of
destinationType. |
void |
setMapperFacade(MapperFacade mapper)
Store an instance of the current MapperFacade which may be used in
mapping of nested types.
|
getAType, getBTypeboolean canConvert(Type<?> sourceType, Type<?> destinationType)
sourceType to destinationType.sourceType - destinationType - D convert(S source, Type<? extends D> destinationType, MappingContext mappingContext)
source into a new instance of
destinationType.source - the source object to be converteddestinationType - the destination type to producemappingContext - since converters now have access to MapperFacade,
they have to pass mapping contextdestinationTypevoid setMapperFacade(MapperFacade mapper)
mapper - the current MapperFacadeCopyright © 2019 Glasnost. All rights reserved.