A Mapping framework (MF) recursively copies data from one object to another. Typically, these data objects will be of different complex types.
MF is built using Dozer framework with several changes as a mapping engine and OpenL Tablets rules framework as a tool which provides convenient mechanism to define conversion rules in declarative way.
The mapper is used any time you need to take one type of Java Bean and map it to another type of Java Bean. It may be used in layered architecture, in distributed systems, for integration with external services and between different frameworks, whenever it’s required to convert or serialize any data model to another similar but different in structure data model.
MF supports simple property mapping, complex type mapping, bi-directional mapping, implicit-explicit mapping, as well as recursive mapping. This includes mapping collection attributes that also need mapping at the element level.
Changes in comparinson with base mapping framework include:
- bi-directional mapping by default
- xpath indexing in collections
- dynamic conditional mapping
- default, required and null/empty mapping enhancements
- multi-source mapping (n-to-1)
- improved hints and convertors
Find implementation details and usage description at Mapping Framework Reference Guide.
To start using Mapping Framework add dependency to your maven pom: