I hope I am not asking a question which don't make any sense. Lets say I have JSON data like below. In JAVA we can access data by using get method (ex. jsonObj.get("field1")
). When it comes to JavaScript we can access data directly using field name (ex. jsonObj.field1
). So my question is, is there anyway in JAVA (or any 3rd party class) which allow me to access JSON data directly using field name?
{
"field1" : "value1",
"field2" : "value2"
}