You can store above into a sttring and seperate it by comma.
String myStr = "{id : 1,member : 123,type : google,src : google}";
String[] values = myStr
.replaceAll("\n","") // remove next line
.split(","); // seperate string by comma
Now you can print values.length which is equal to number of fields.
Hope that helps.