Wednesday 25 October 2017

How to find specified name and its value in JSON-string from Java?

Let's assume we have the next JSON
string:



{ 
"name" :
"John",

"age" : "20",
"address" : "some
address",
"someobject" : {
"field" : "value"

}
}


What is
the easiest (but still correct, i.e. regular expressions are not acceptable) way to find
field age and its value (or determine that there's no field
with given name)?




p.s. any
open-source libs are ok.



p.s.2: please, don't
post links to the libraries - it's not a useful answer. 'Show me the
code'(c).

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...