vadbch / orika

Automatically exported from code.google.com/p/orika
0 stars 0 forks source link

Bypass mapping for empty string value and Trim the source string value during source to destination filed mapping #192

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi Team,

Currently my application is using Dozer mapping framework and i am planning to 
replace Dozer with Orika mapping framework. For this i am doing a small POC in 
Orika and during implementation i am looking below two configuration features 
in Orika as we have in Dozer. 

1. How we can bypass the mapping for empty string values.
2. How we can trim the source string value at run time while mapping value from 
source to destination. 

Thanks in Advance.

Original issue reported on code.google.com by lovelish...@gmail.com on 25 Feb 2015 at 2:50

GoogleCodeExporter commented 8 years ago
Hello,

Actually you can use Filter API to this kind of things
: skip or transforming the value before the copy; as long as the value keeps 
it's type if not you should also try to use a Converter

Original comment by elaat...@gmail.com on 25 Feb 2015 at 9:00

GoogleCodeExporter commented 8 years ago
Thanks for Quick reply.

It will be great help if you send me some sample implementation of Filter API.

Original comment by lovelish...@gmail.com on 26 Feb 2015 at 7:58

GoogleCodeExporter commented 8 years ago
You can look at 
https://github.com/orika-mapper/orika/blob/master/tests/src/main/java/ma/glasnos
t/orika/test/filters/FilterTestCase.java

and this documentation:
http://orika-mapper.github.io/orika-docs/filters.html

Original comment by elaat...@gmail.com on 26 Feb 2015 at 9:29

GoogleCodeExporter commented 8 years ago
Thanks a lot for your help.

Original comment by lovelish...@gmail.com on 26 Feb 2015 at 1:52