I want to retrieve field values by passing filed name .in order to achieve that i have implemented a method which loop through the ISOMsg object and then if it found a match to the passed filed name then it returns .my requirement is to read the .xml file once and have a static map using that then on the next time retrieve corresponding value by passing field name in order to achieve this is there a way to retrieve all field in config xml.
protected static void getISO8583ValueByFieldName(ISOMsg isoMsg, String fieldName) {
for (int i = 1; i <= isoMsg.getMaxField(); i++) {
if (isoMsg.hasField(i)) {
if (isoMsg.getPackager().getFieldDescription(isoMsg, i).equalsIgnoreCase(fieldName)) {
System.out.println(
" FOUND FIELD -" + i + " : " + isoMsg.getString(i) + " " + isoMsg.getPackager()
.getFieldDescription(isoMsg, i));
break;
}
}
}
}
Solution is to implement a own custom mapper.here is an memory implementation singleton class which reads all the configurations one time and then provide key id by name.
Example
}