Closed GoogleCodeExporter closed 9 years ago
jackson is best used using annotations and the ObjectMapper. See
https://github.com/hielkehoeve/wiquery-jqplot/blob/master/src/main/java/nl/topic
us/wqplot/components/JQPlot.java
and
https://github.com/hielkehoeve/wiquery-jqplot/blob/master/src/main/java/nl/topic
us/wqplot/options/PlotAxes.java
Original comment by hielke.hoeve
on 16 Feb 2011 at 1:55
Of course, I mean generate some json with jackson (not with our own methods)
Original comment by roche....@gmail.com
on 16 Feb 2011 at 2:25
Fixed in r719
Just a little method:
/**
* Method using the jackson API to generate a json representation of your
* Java object
* @param jsonObject A serializable object
* @return the json representation as a string
* @throws IOException Exeption during the process
*/
public static String json(Serializable jsonObject) throws IOException {
StringWriter sw = new StringWriter();
JsonGenerator gen = new JsonFactory().createJsonGenerator(sw);
new ObjectMapper().writeValue(gen, jsonObject);
return sw.toString();
}
Original comment by roche....@gmail.com
on 27 Feb 2011 at 2:05
Original issue reported on code.google.com by
roche....@gmail.com
on 16 Feb 2011 at 8:24