Just try to traverse the json with the name of the variable
json={
"responses":[
{
"textAnnotations":[],
"fullTextAnnotation":{
"pages":[],
"text":"texto a obtener"
}
}
]
};
console.log(json.responses[0].fullTextAnnotation.text)
Update
For JAVA you can use the library java-json.jar
package stackoverflow;
import org.json.JSONException;
import org.json.JSONObject;
public class StackOverflow {
public static void main(String[] args) throws JSONException{
JSONObject json = new JSONObject("{\"responses\":[ \n" +
" { \n" +
" \"textAnnotations\":[],\n" +
" \"fullTextAnnotation\":{\n" +
" \"pages\":[],\n" +
" \"text\":\"texto a obtener\"\n" +
" }\n" +
" }\n" +
" ]\n" +
"}");
System.out.println(json.getJSONArray("responses").getJSONObject(0).getJSONObject("fullTextAnnotation").get("text").toString());
}
}