madago227 Posted August 15, 2016 Posted August 15, 2016 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
Token Posted August 15, 2016 Posted August 15, 2016 Write your own JSON parser that doesn't rely on reflection 1
madago227 Posted August 15, 2016 Author Posted August 15, 2016 How do you write json parser without reflection, create new java calls for each json data class structure?
Token Posted August 15, 2016 Posted August 15, 2016 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
madago227 Posted August 15, 2016 Author Posted August 15, 2016 made a .bat file with javaw -jar "osbot 2.4.84.jar" -allow reflection