Hi All, I am trying to parse the client request and based on strucure trying to form a jTree.Sample request is below-
^class^="Voucher" MSISDN="566773" TopupValue="500" Tax="56"
MyOrder={ ^class^="Order" OrderID="221" OrderAddress="Bangalore/KA" OrderDetails="100 boxes"
Company_Info={ ^idx^=1 ^class^="CompanyDetails" CompanyName="MICROSOFT"
CompanyAddress="USA" CompanyEmployees=32 }
Travel={ ^idx^=1 ^class^="Transport" TransportType="CAB"
Total_Buses=34 MonthlyExpense=455 AIR="NO" RAIL="YES" SEA="NO" }
ListOfCities={ ^idx^=2 ^class^="CITYLIST" ^1^="MUMBAI" ^2^="BANGALORE" ^3^="HYDERABAD" }
ListOfStates={ ^idx^=3 ^class^="StateList" ^1^="Maharashtra" ^2^="Karnataka" } }
ListOfCountries={ ^idx^=3 ^class^="CountryList" ^1^="India" ^2^="Bangla Desh" } }
As you can see, root node is Voucher and its attibutes, Order is inside it, CompanyDetails is inside Order and so on. This is just a sample request.Another request may/may not contain say Company_Info. How to parse such kind of requests? I am not asking for code but just the approach.Will i be able to achive this using only String/buffer methods? Request is received as java String.