public static HashMap<String, String> getChildData(String requestID) {
String methodName = "getChildData";
System.out.println(CLASS_NAME + "/" + methodName + "; Request ID = " + requestID);
HashMap functionRoleApplicationMap = new HashMap();
try {
Request request = getRequestObject(requestID);
List beneficiaryList = request.getBeneficiaries();
List reqBeneficiaryEntityList = ((Beneficiary) beneficiaryList.get(0)).getTargetEntities();
List<RequestBeneficiaryEntityAttribute> reqBeneficiaryEntityAttributeList = ((RequestBeneficiaryEntity) reqBeneficiaryEntityList
.get(0)).getEntityData();
for (RequestBeneficiaryEntityAttribute reqBeneficiaryEntityAttribute : reqBeneficiaryEntityAttributeList) {
if (reqBeneficiaryEntityAttribute.getName().equalsIgnoreCase("TABLE_NAME")) {
List<RequestBeneficiaryEntityAttribute> childAttributeList = reqBeneficiaryEntityAttribute
.getChildAttributes();
String fieldName = "";
String fieldValue = "";
for (RequestBeneficiaryEntityAttribute childAttribute : childAttributeList) {
if (childAttribute.getName().equalsIgnoreCase("Field Name")) {
fieldName = childAttribute.getValueHolder().toString();
}
if (childAttribute.getName().equalsIgnoreCase("Field Value")
&& null != childAttribute.getValueHolder()) {
fieldValue = childAttribute.getValueHolder().toString();
}
}
// System.out.println(fieldName + "==" + fieldValue);
functionRoleApplicationMap.put(fieldName, fieldValue);
}
}
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("Exiting from the method : " + methodName);
return functionRoleApplicationMap;
}
No comments:
Post a Comment