I want to read a JSON object from a JSON file in Java, as a string without any processing. The problem is that in the JSON file, the objects are not on a single line. (else it would have been easy to read them with scanner.nextLine() ) Also, in the program I will need to read the objects based on their ID, which is one of the object key.
If I map them to the corresponding POJO, later to convert it into a JSON string, I'll end up with a default value for attributes not present in a particular object and the key-value pair will show up in the string, which I don't want. I just need the original string as it as.
Any suggestion on the approach I can go with?
Thanks in advance!