'jackson parser'에 해당되는 글 1건

  1. 2013.04.02 :: jackson parser sample
Computer_IT/JAVA 2013.04.02 13:54


import com.fasterxml.jackson.core.JsonGenerationException;

import com.fasterxml.jackson.databind.JsonMappingException;

import com.fasterxml.jackson.databind.ObjectMapper;

import com.fasterxml.jackson.databind.SerializationFeature;


...

....

....


public static String getJSON(Map<?, ?> map) throws JsonGenerationException, JsonMappingException, IOException

{

if (map == null ) return null;

ObjectMapper mapper = new ObjectMapper();


// pretty format

mapper.configure(SerializationFeature.INDENT_OUTPUT, true);

StringWriter sw = new StringWriter();

mapper.writeValue(sw, map);

return sw.toString();

}


'Computer_IT > JAVA' 카테고리의 다른 글

JDK 7 release - Bug Fixes history  (0) 2014.10.20
eclipse @author 변경하기  (0) 2013.07.02
jackson parser sample  (0) 2013.04.02
VisualSVN Post-commit hook  (0) 2013.02.04
마이피플 위젯 전송 자바 샘플  (0) 2012.07.11
myBatis multi db vendor support  (0) 2011.12.07
posted by 고급코드 고급코드