java json convert to List
·
Language/JAVA
List blockList = new ArrayList (); String ttt = "{\"list_block\":[\"01011111111\", \"01011112222\"]}"; JsonNode root = new ObjectMapper().readTree(ttt); // 배열에 있는 값들 가져오기 if( root.path("list_block").isArray() ){ Iterator it = root.path("list_block").iterator(); while(it.hasNext()){ blockList.add(it.next().getTextValue()); } }