1String message;
2JSONObject json = new JSONObject();
3json.put("name", "student");
4
5JSONArray array = new JSONArray();
6JSONObject item = new JSONObject();
7item.put("information", "test");
8item.put("id", 3);
9item.put("name", "course1");
10array.add(item);
11
12json.put("course", array);
13
14message = json.toString();
15
16// message
17// {"course":[{"id":3,"information":"test","name":"course1"}],"name":"student"}
1JSONObject jsonObject = //...
2JsonNode jsonNode = convertJsonFormat(jsonObject);
3ObjectMapper mapper = new ObjectMapper();
4MyPojoClass myPojo = mapper.readValue(new TreeTraversingParser(jsonNode), MyPojoClass.class);