Object转Json
package utils;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import net.sf.json.JsonConfig;
import net.sf.json.util.CycleDetectionStrategy;
import net.sf.json.xml.XMLSerializer;
import pojo.Category;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/*
使用jdk内置的 json-lib 工具
JSONArray转换器:fromObject(数组/list集合)--->JSONArray.toString()
JSONObject转换器:fromObject(Map/实体对象)--->JSONObject.toString()
*/
/**
* 处理json数据格式的工具类
*
*
*/
public class JsonUtils {