Here you can find the source of encode(Object o)
public static String encode(Object o) throws IOException
//package com.java2s; //License from project: Open Source License import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; public class Main { private static final ObjectMapper om = new ObjectMapper(); public static String encode(Object o) throws IOException { return om.writeValueAsString(o); }/*from ww w.java 2s .c o m*/ }