import com.example.JsonIOFramework; public class Main { public static void main(String[] args) { Person person = new Person("John", 25); String json = JsonIOFramework.serialize(person); System.out.println(json); Person deserializedPerson = JsonIOFramework.deserialize(json, Person.class); System.out.println(deserializedPerson.getName()); System.out.println(deserializedPerson.getAge()); } } class Person { private String name; private int age; } JsonIOFramework.setDateFormat("yyyy-MM-dd"); JsonIOFramework.setNullValueHandling(NullValueHandling.SERIALIZE); JsonIOFramework.setPropertyMapping("firstName", "name");


上一篇:
下一篇:
切换中文