📜  java 对象到 json - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:05.747000             🧑  作者: Mango

代码示例3
import com.fasterxml.jackson.databind.ObjectMapper; 
import com.fasterxml.jackson.databind.ObjectWriter; 

ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter();
String json = ow.writeValueAsString(object);