How to find mappings of attribute in Dozer at runtime?
I use Dozer to map between Java beans. I have a dozer mapping file with all the mappings present in it. A sample mapping is shown below:
<mapping>
<class-a>com.xyz.A</class-a>
<class-b>com.xyz.B</class-b>
<field>
<a>key</a>
<b>id</b>
</field>
<field>
<a>actionId</a>
<b>action</b>
</field>
</mapping>
Now I want to find the mappings at runtime. For e开发者_StackOverflow社区xample, give a field as a string com.xyz.A.key
, I want to find that it maps to com.xyz.B.id
programatically. I looked into the Dozer API (org.dozer.Mapper
interface) and it exposes methods only to map beans.
So my question is: is there an API to find the mappings programatically?
精彩评论