Skip to content

Tag: deserialization

How to parse TOML document with Java

In my Java app I get a TOML document from REST service response as String and I look how to parse it and convert to Java objects. Ideally I’d like to use some existing mapper library for deserialization, something like Jackson or Gson for JSON objects. Are there any options in Java ecosystem for that? Answer There are several libraries

Get object from .readEntity

I have a java service which calls an API and gets the following in return How can i use .readEntity (or something else) to get the object for a given field; say service2 Or just convert all objects inside status to a List<> of objects String output = response.readEntity(String.class); works, but i dont know how to parse it properly to

Can I apply a custom deserializer to within another custom deserializer for GSON

The below is a working code that helps to convert JSON in Object accordingly. If the String is nil, it will be treated as null. There’s 2 custom deserializer i.e. MyOwnStringDeserializer and MyOwnListDeserializer. I am not happy with MyOwnListDeserializer deserializer, as essentially what it is doing is in term of the String comparison to the rule defined in MyOwnStringDeserializer. But