기본 콘텐츠로 건너뛰기

5월, 2018의 게시물 표시

java json string -> map

org.codehaus.jackson jackson-mapper-asl 1.9.13 ObjectMapper mapper = new ObjectMapper(); String jsonStr = ruleInfo.getRuleJson(); Map map = new HashMap (); // convert JSON string to Map map = mapper.readValue(jsonStr, new TypeReference >(){}); System.out.println(map); ArrayList aL = (ArrayList) map.get("actions"); System.out.println( aL.get(0) );