Skip to content
Advertisement

JSON object from java ObjectName.toString

I have a java object witch generates this output when i type objectName.toString() :

JavaScript

Is there a JSON parser that lets me make a JSON from the string that my object generates? something like: JsonObject x = new JsonObject(busObject.toString())

It is important for me to generate it from the string that i get when calling the .toString method.

Any help is appreciated.

Advertisement

Answer

I have fixed my problem by overriding my toString() and printing directly a json object

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement