java - Gson get list of objects from json -
i have json string contains array of objects(filters array). json string has other objects , fields im interested in parsing json array. can tell me how can using gson? here json file: { name: "test json", test_ob: { name: "test" } filters[ { test: 1, test: 2, ... } ... ] } and code: filters filters = new gson().fromjson(jsoncontent.tostring(), filters.class); and filters class: public class filters { private list<filter> filters; public list<filter> getfilters() { return filters; } public void setfilters(list<filter> filters) { this.filters = filters; } } is json valid? try this: data.json: { name: "test json", test_ob: { name: "test" }, filters: [ { name: filter1, value: 1 }, { name: filter2, value: 2 } ] } filter.java: public class filter { priva...