samedi 28 février 2015

Jackson Mapper configuration needed for Spring REST JSON object

I am getting the following JSON object via a REST API call and I want to be able to pick the information inside the results JSON array and convert the same in POJO for e.g ExchangeListInfo,RedeemCall ... IncomeInformation only


How do i get this done with Jackson 1-9.0 api, I have written some code snippet as well but I cannot seem to figure out how to get the mapping to work in this complex scenario , Any help is appreciated



{
"code": 200,
"results": [
{
"_id": "5168521",

"ExchangeListInfo": {
"InstrumentListingLevel": "ANC",
"SettlementCurrency": "UAH"
},
"RedeemCall": {
"IsMWholeCall": false
},
"MsdInformation": {
"MSDCallPutFlag": "P",
"MSDMinimumDenomination": 1000.0,
"MSDCouponFrequency": "Q",
"MSDBondForm": "B",
"MSDSovDebtFlag": false,
"MSDDatedDt": "2007-04-26T00:00:00.000-04:00",
"MSDMaturityDt": "2010-04-22T00:00:00.000-04:00"
},
"SecInformation": {
"PutFreq": "EQ",
"ItDivFreq": "QWE",
"ItBasDysTyp": "4123",
"PuTyp": "1O"
},
"ConversionBasic": {
"ConversionMandatoryFlag": false
},
"IncomeInformation": {
"AccrualMethod": "ACT/365",
"NextPayDate": "2010-04-22T00:00:00.000-04:00",
"CouponDividendRate": 0.0,
"CouponDividendType": "KAR",
"CouponDividendCurrency": "9AH",
"CouponDividendFrequency": 4,
"LastPayDate": "2010-01-21T00:00:00.000-05:00",
"FirstPayDate": "2007-07-26T00:00:00.000-04:00",
"PreviousPaymentDate": "2010-01-21T00:00:00.000-05:00",
"DatedDate": "2007-04-26T00:00:00.000-04:00",
"IsPayInKind": false,
"UnadjustedPreviousCouponPayDat": "2010-01-21T00:00:00.000-05:00"
},

"version": 1,
"id": 1615,
"cloudstamp": "2010-12-04T11:46:20.739-05:00"
}
]//end of results
}

Aucun commentaire:

Enregistrer un commentaire