Conversion assembly between objects: Dozer

In the development process, often involving conversion between objects, bean to dto to vo etc., dozer components is a good target conversion.

It may be a copy of an object to another object recursively. It supports both simple object mapping, and also supports complex object mappings.

dozer supports two mapping methods, calling simple way api mapping and the use of xml mapping mode.

api calls way bound member variable name two bean we defined to be as easy to automatically mapped, as can be different types, such as Integer num member variables of class A and class B of String num can be directly mapped.

Xml is a way to define mapping rules by writing xml file.

When using the dozer, dozer only need to add a dependent to below as an example maven (the latest version number can be modified according to):

 

Guess you like

Origin www.cnblogs.com/westlife-11358/p/12081926.html