0

[{"statusCode":200,"body":null,"string":"{\"authenticationResultCode\":\"ValidCredentials\",\"brandLogoUri\":\"http:\\\/\\\/dev.virtualearth.net\\\/Branding\\\/logo_powered_by.png\",\"copyright\":\"Copyright © 2016 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.\",\"resourceSets\":[{\"estimatedTotal\":1,\"resources\":[{\"__type\":\"Location:http:\\\/\\\/schemas.microsoft.com\\\/search\\\/local\\\/ws\\\/rest\\\/v1\",\"bbox\":[38.251775282429321,-85.764416391531825,38.259500717570674,-85.751299608468173],\"name\":\"425 W Market St, Louisville, KY 40202\",\"point\":{\"type\":\"Point\",\"coordinates\":[38.255638,-85.757858]},\"address\":{\"addressLine\":\"425 W Market St\",\"adminDistrict\":\"KY\",\"adminDistrict2\":\"Jefferson Co.\",\"countryRegion\":\"United States\",\"formattedAddress\":\"425 W Market St, Louisville, KY 40202\",\"locality\":\"Louisville\",\"postalCode\":\"40202\"},\"confidence\":\"High\",\"entityType\":\"Address\",\"geocodePoints\":[{\"type\":\"Point\",\"coordinates\":[38.255638,-85.757858],\"calculationMethod\":\"Parcel\",\"usageTypes\":[\"Display\"]},{\"type\":\"Point\",\"coordinates\":[38.255367279052734,-85.757896423339844],\"calculationMethod\":\"Interpolation\",\"usageTypes\":[\"Display\",\"Route\"]}],\"matchCodes\":[\"Good\"]}]}],\"statusCode\":200,\"statusDescription\":\"OK\",\"traceId\":\"6bcd334413524cdba8d5c58e85cc1028|HK20271556|02.00.153.400|HK2SCH010280724, HK2SCH010310229\"}"}]

This my Input, it's in string format single row value.
Need to get all the values inside(resourceSets tag) how do I get those values ?

Sandeep
  • 1,504
  • 7
  • 22
  • 32

2 Answers2

0

Try with the Gson library... the method fromJson and a POJO are all you need.

Matteo Baldi
  • 5,613
  • 10
  • 39
  • 51
0

You can always use a ObjectMapper (jackson library) and map it to a POJO that fits in the JSON you are sending or use Guava libraries for that (check: JSON parsing using Gson for Java)

Community
  • 1
  • 1