August 15, 20169 yr I want to parse the grand exchange website with my json parser using google gson, but you guys block the reflection api, what do do i
August 15, 20169 yr Author How do you write json parser without reflection, create new java calls for each json data class structure?
August 15, 20169 yr How do you write json parser without reflection, create new java calls for each json data class structure? Parsing without reflection means you have to know the structure of the JSON. All you have to do if read the document and interpret it as fields and values { "item": { "name":"Cannonball", "id":2, "price":340 } } translates into public class Item { private String name; private Integer id; private Integer price; } So you can read the page into a string, get rid of "item": { } and " ", split by , and you will have field:value pairs which you can insert into your Item instances
Create an account or sign in to comment