简体   繁体   中英

How can I deserialize json object where in keys are present pointer?

I need to deserialize this json

{"dal.device.status":1,"dal.device.UID":"ZigBee:Yale Doorlock:ah.app.3781220503199452-1","service.bundleid":77,"dal.device.driver":"ZigBee","service.id":159,"service.scope":"singleton"}

But I don't how to do since there are pointers in key (eg "dal.device.status") I'm using google gson.
I'm able to deserialize this object using C# and Newtonsoft library using ClassAttributes. Is there something similar for java?

First question when seeing properties with dot in them in a json should be "god, oh god, why ? why all this hatred ?"

But if earth is at stake, you can simply deserialize this mess into an hashmap using gson and work from here.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM