Reputation: 715
I have to transform a simple bean into another complex bean which will ultimately marshaled into XML.
The mapping between the pojo fields can be configured by user through UI.
Can someone tell me the best approach or framework.
Dozer requires us to define mapping in their XML format or using API but I need a dynamic transformation rule.
User can just provide mapping of fields names but we have to do type and structure conversion.
Upvotes: 0
Views: 947
Reputation: 5840
Why not to use dozer? You can build BeanMappingBuilder configuration object according to configuration from your UI and then create mapper from this dynamically created configuration this way
DozerBeanMapper mapper = new DozerBeanMapper();
mapper.addMapping(builder);
Which type of dynamic is not enough for you in this approach?
Upvotes: 2