addNestedMapper

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2070 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Keith Donald
2009-10-07 17:50:03 +00:00
parent 89e7caa35b
commit 9e7b87105b
2 changed files with 15 additions and 5 deletions
@@ -115,6 +115,16 @@ public class SpelMapper implements Mapper<Object, Object> {
return mapping;
}
/**
* Adds a Mapper to apply to complex nested property mappings of a specific sourceType/targetType pair.
* @param sourceType the source nested property type
* @param targetType the target nested property type
* @param nestedMapper the nested mapper
*/
public void addNestedMapper(Class sourceType, Class targetType, Mapper<?, ?> nestedMapper) {
this.conversionService.addGenericConverter(sourceType, targetType, new MapperConverter(nestedMapper));
}
/**
* Return this mapper's converter registry.
* Allows for registration of simple type converters as well as converters that map nested objects using a Mapper.