[Solved] How to search for values inside Json file


how about using ObjectMapper

final String json = "{\"yourjson\": \"here\", \"andHere\": ... }";
final ObjectNode node = new ObjectMapper().readValue(json, ObjectNode.class);

if (node.has("ID")) {
    System.out.println("ID: " + node.get("ID"));
} 

This is one of the many ways:

Adding for GSON,

String json = "your json here" // you can also read from file etc
    Gson gson = new GsonBuilder().create();
    Map jsonMap = gson.fromJson(json, Map.class);
    System.out.println(jsonMap.get("ID"));

Explore more.

thanks

1

solved How to search for values inside Json file