public static void dozerConverter(Map csvFileMap){
DozerBeanMapper dozerBeanMapper = new DozerBeanMapper();
dozerBeanMapper.setMappingFiles(Arrays.asList("CASHIN_SC.xml"));
Map destFileMap = dozerBeanMapper.map(csvFileMap , HashMap.class , "BULK_BILLPAY");
for (Map.Entry entry : destFileMap.entrySet())
System.out.println("Key = " + entry.getKey() +
", Value = " + entry.getValue());
}
public static void main(String[] args) {
Map csvFileMap = new HashMap<>();
csvFileMap.put("patil Provider", "basan");
csvFileMap.put("Bank", "patil");
dozerConverter(csvFileMap);
}
xml version="1.0" encoding="UTF-8"?>
<mappings xmlns="http://dozer.sourceforge.net"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://dozer.sourceforge.net
http://dozer.sourceforge.net/schema/beanmapping.xsd">
<mapping wildcard="false" map-id="BULK_BILLPAY" map-null="false" type="one-way">
<class-a>java.util.Map</class-a>
<class-b>java.util.Map</class-b>
<field>
<a key="patil Provider">this</a>
<b key="sendermfsprovider">this</b>
</field>
<field>
<a key="Bank">this</a>
<b key="bank">this</b>
</field>
<field>
<a key="id">this</a>
<b key="id">this</b>
</field>
</mapping>
</mappings>
No comments:
Post a Comment