@Test public void testToJson() { User user = new User(); user.setName("名称"); user.setDesc("测试"); user.setAge(27); assertEquals("{\"name\":\"名称\",\"age\":27}", JsonUtil.toJson(user, "desc")); }
public static String toJson(Object obj, String... ignoreProperties) { return gson(ignoreProperties).toJson(obj); }
JsonUtil { public static String toJson(Object obj, String... ignoreProperties) { return gson(ignoreProperties).toJson(obj); } }
JsonUtil { public static String toJson(Object obj, String... ignoreProperties) { return gson(ignoreProperties).toJson(obj); }  }
JsonUtil { public static String toJson(Object obj, String... ignoreProperties) { return gson(ignoreProperties).toJson(obj); }  static T fromJson(String json, Class<T> clazz); static String toJson(Object obj, String... ignoreProperties); static Gson gson(String... ignoreProperties); static Gson gson1(String... ignoreProperties); static ExclusionStrategy getExclusionStrategy(String... ignoreProperties); }
JsonUtil { public static String toJson(Object obj, String... ignoreProperties) { return gson(ignoreProperties).toJson(obj); }  static T fromJson(String json, Class<T> clazz); static String toJson(Object obj, String... ignoreProperties); static Gson gson(String... ignoreProperties); static Gson gson1(String... ignoreProperties); static ExclusionStrategy getExclusionStrategy(String... ignoreProperties);  }