I need a Java (Core) Program to do the below requirement:
Program Inputs : XML, given below the structure.
<HEAD>
<DATA>BANKLOGIN</DATA>
</HEAD>
<BODY>
<PART1>
<BANKERNAME> Mr. ABCV </BANKERNAME>
<BANKERACC> 09090000000000 </BANKERACC>
<BANKERHOMBRCH> ABC </BANKERHOMBRCH>
<BANKERCUSTID> 8909000000 </BANKERCUSTID>
</PART1>
<PART2>
<BANKERADDRS> No 12, MUI Street,First Right, RUTY, INDIA</BANKERADDRS>
<BANKERCDFLAG> C </BANKERCDFLAG>
<BANKERBALFLAG> OK </BANKERBALFLAG>
<BANKERTRANSFLAG> YES </BANKERTRANSFLAG>
<BANKERLOANFLAG> Y </BANKERLOANFLAG>
<BANKERACCTYPE> SAVING </BANKERACCTYPE>
</PART2>
<PART3>
<LOGINMODE> MOBILE </LOGINMODE>
<LOGINMODEL> NOKIA XPRESS </LOGINMODEL>
<LOGINAPPAVAILFLAG> N </LOGINAPPAVAILFLAG>
<LOGINREGISTEREDID> N/A </LOGINREGISTEREDID>
<LOGINAMOUNT> 1.00 </LOGINAMOUNT>
</PART3>
<PART4>
<OFFERFLAG1> FUEL </OFFERFLAG1>
<OFFERFLAG2> SHOP </OFFERFLAG2>
<OFFERFLAG3> GLOD-UP </OFFERFLAG3>
</PART4>
</BODY>
<FOOTER>
<DATA> SESSIONID </DATA>
</FOOOTER>
The Java Program should take the above XML as input and convert the XML data and produce a file, in which all data should come in a single line with the delimeter ~ . Including all three Header, Body and Footer. Place a special Character "SP" once Header ends, and place "DP" once Body ends, and place "OP" once Footer ends.
Sample:
BANKLOGIN~SP~Mr. ABCV~09090000000000~ABC~8909000000~No 12, MUI Street,First Right, RUTY, INDIA................etc
Also, I have to use the XML data where ever i want in the same package with a defined method name with the tag name. For Example. If i need the tag <lOGINMODEL> under <PART3> under <BODY>, I will call a method like:
String loginModel = XMLManager.getXMLdata().getBODY().getPART3().getLoginModel();
Where,
XMLManager is the class name to implement all the above defined methods
Also,
If I want to set all the <PART3> data under <BODY> to session, i have to use like :
setSession("AFTERTFL_XMLDATA_BODY_PART3", XMLManager.getXMLdata().getBODY().getPART3());
Like the above, all data should be achievable.
-----------Try and let me know if u complete or need any Additional Info------------
<Estimated Duration: 2 weeks>