The faq explains how to do this in XML. This shows how to do it per class using the API. The problem is you have to set it on on the class. What if I only want it on one
For the sake of future readers: the solution with the custom converter did not work for me. It seems that the converters are just being ignored during the mapping.
However, defining custom field mapper did work quite well: (written in java 8)
dozerBeanMapper.setCustomFieldMapper((source, destination, sourceFieldValue, classMap, fieldMapping) ->
sourceFieldValue == null);
This mapper returns a boolean indicating weather the mapping was done for that field. So, returning true if the object is null, will notify Dozer that the mapping was finished. Sending false will continue the default mapping. (See MappingProcessor.java - mapField method)