private MapperFacade mapper;
private MapperFacade addressMapper;
public OrikaListMapper() {
final MapperFactory factory = new DefaultMapperFactory.Builder().build();
factory.registerClassMap(factory.classMap(Address.class, AddressDTO.class).
field("addressLine1", "addressLine1").
field("addressLine2", "addressLine2").
field("postCode", "postCode").
field("city", "city").
field("country.name", "countryName").
toClassMap()
);
factory.registerClassMap(factory.classMap(Person.class, PersonWithHistoryDTO.class).
field("id", "id").
field("name.firstname", "firstName").
field("name.surname", "lastName").
field("currentAddress", "currentAddress").
field("previousAddresses", "previousAddresses").
toClassMap()
);
this.mapper = factory.getMapperFacade();
}