This week's book giveaway is in the Reactive Progamming forum. We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line! See this thread for details.
First of all I was not sure where to post this since it is about JSON which is AJAX-related, but my question has to do with server-side manipulation.
I am trying to deserialise a JSON-RPC object with Jackson. The format of JSON-RPC is :
In my case the result property is an generic Object.
I have a class for deserilising the response:
I can get the response object with:
I want to have a generic method that deserializes this result object by passing to the method the type of the object (or the class if you want) that is going to be deserialized to. This way I can pass any type of object depending of the response I expect.
For example, I have this class with two properties:
The result object inside the response for the above case will be:
where result is a JsonNode intance of the result (Which for some reason is a LinkedHashMap) and objectClass the class I want it to deserialize to. But this is not working.
I busted my head all day with different ways of doing this but I probably do not understand who Jackson works.
Can anyone help me with this?
Thank you in advance.
WARNING! Do not activate jet boots indoors or you will see a tiny ad: