I'd like to map a CustomConverter in dozer but I'd like to pass the whole current object as the source. All of the examples in the dozer CustomConverter documentation pass a field of the input object as the source and not the whole object.
I'd like to do something like this:
<mapping>
<class-a>foo.bar.InputObject</class-a>
<class-b>foo.bar.OutputObject</class-b>
<field custom-converter="foo.bar.MyConverter">
<a>this</a> <!-- how do I access the whole value and not just a field? -->
<b>custom</b>
</field>
<field>
<a>anotherField</a>
<b>anotherField</b>
</field>
</mapping>
And
public class MyConverter extends DozerConverter<InputObject, String> {
...
public String convertTo(InputObject input, String custom) {
// do some transformation
}
}
CustomConverter docs here: http://dozer.sourceforge.net/documentation/customconverter.html
Try implementing the CustomConverter instead of DozerConverter and try passing it as: