Flexjson是一个将Java对象转成JSON的类库,是一个深度转换的过程
示例代码:
publicStringdoSomething(Objectarg1,...){ Personp=...loadaperson...; JSONSerializerserializer=newJSONSerializer(); returnserializer.serialize(p);}
执行结果:
{"class":"Person","name":"WilliamShakespeare","birthday":-12802392000000,"nickname":"Bill"}
在线APIdoc:https://www.ostools.net/apidocs/apidoc?api=flexjson
评论