对象存在fastjson ----JSONObject中,然后取出来
eg.FaceKeyLandmarks
//取的过程
JSONObject iFaceKeyAndPhysiognomy = iCoreService.faceppdetectDes(file, fcolor);
Object landmarks =iFaceKeyAndPhysiognomy.get("faceKeyLandmarks");
JSONObject json = (JSONObject)JSON.toJSON(landmarks);
FaceKeyLandmarks faceKeyLandmarks=json.toJavaObject(FaceKeyLandmarks.class);
//存的过程
JSONObject result = new JSONObject();
//构造对象
FaceKeyLandmarks faceKeyLandmarks=new FaceKeyLandmarks();
result.put("faceKeyLandmarks",faceKeyLandmarks);
本文介绍如何使用FastJSON在Java中处理对象,包括将对象转换为JSONObject并从JSONObject中取出对象的过程。通过具体示例,展示了如何构造FaceKeyLandmarks对象,并将其存入和取出JSONObject。
1611

被折叠的 条评论
为什么被折叠?



