String to Date mapping in Dozer

String to Date mapping in Dozer can be configured in multiple ways using the XML configurations.

1. Field Level Mapping

Date format in which date needs to be parsed can be specified on that particular field

2. Class Level Mapping

For many fields a default class level mapping can be specified

3. Top Level Mapping

A default date format can also be specified at the very top mappings level. This default date format will be applied to all field mappings unless it is overridden at a lower level.

Lets see an simple example on this
SourceBean

DestinationBean

Mapper XML
We will use both field and class level mappings

Now lets convert

Output
String to Date mapping in Dozer

References
1. String to Date mapping – Dozer Guide

It's only fair to share...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn