[JSONObject] Maven Dependency 설정
ITWeb/개발일반 2013. 5. 7. 17:20json 관련 라이브러리가 상당히 많이 있습니다.
입맛에 맞게 사용하시면 됩니다.
http://json-lib.sourceforge.net/
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk13</classifier>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
[예제코드]
JSONObject jsonObject = JSONObject.fromObject(esDataIndex.getIndexList(host, port));
Map map = jsonObject;
http://jackson.codehaus.org/
http://mvnrepository.com/artifact/org.codehaus.jackson
- maven dependency 설정 참고
[예제코드]
ObjectMapper mapper = new ObjectMapper();
Map<String, Object> hash = mapper.readValue(JSON_STRING, new TypeReference<Map<String, Object>>() {});