AnsweredAssumed Answered

How to map node's properties from JSON format to Map<QName, Serializable> Java object?

Question asked by mbel on Dec 7, 2016
Latest reply on Dec 13, 2016 by afaust

I have a JSON representation of the properties of a node:


"properties": {
"{}email": "",
"{}homeFolder": {
"storeRef": {
"protocol": "workspace",
"identifier": "SpacesStore"
"id": "b2e97ee9-1154-411e-b9b7-a7d105049b0a"
"{}cascadeTx": 163,
"{}lastName": "",
"{}preferenceValues": {
"id": 290,
"contentUrl": "store://2016/11/28/22/56/92a777ff-5dbe-461b-8d09-565d94182254.bin",
"mimetype": "text/plain",
"size": 275,
"encoding": "UTF-8",
"locale": "en_US"
"{}organizationId": "",
"{}node-uuid": "e8d408b8-1e7b-41c2-8722-0f7327df6919",
"{}name": "e8d408b8-1e7b-41c2-8722-0f7327df6919",
"{}sizeCurrent": 0,
"{}store-protocol": "workspace",
"{}store-identifier": "SpacesStore",
"{}node-dbid": 32,
"{}locale": "en_US",
"{}userName": "admin",
"{}homeFolderProvider": "bootstrapHomeFolderProvider",
"{}owner": "admin",
"{}cascadeCRC": 133767139,
"{}firstName": "Administrator"



And I have an issue while mapping it to Map<QName, Serializable> Java object.
I can easily parse the String to QName, but I have a problem with the Serializable interface:


11070010 Can not construct instance of, problem: abstract types either need to be mapped to concrete types, have custom deserializer, or be instantiated with additional type information at [Source:$HttpInputStream@6a5c3c62; line: 1, column: 22376] 


Is there any way of getting the type against an QName in order to parse it automatically to that type?
Example -> "{}locale":  -> Locale.class
Or if someone has some other suggestions, I will be happy if you can share them.


Thank you in advance.