These forums have been archived and are now read-only.
The new forums are live and can be found at https://forums.eveonline.com/
CCP employees and #devfleet - should json be object oriented?
"{}" = delimits an object"[]" = delimits a variable sized list":" = delimits label from value"," = delimits objects in a list as well as child objects"()" delimits a type{ "endpoints":{ "serverName"(String):, "serverVersion"(String):, "userCount"(Integer), "serviceStatus"(Boolean):[{ (EndpointGroup) "groupName"(String):[ (Endpoint){ "name":(String),"uri":(String) } ] } ] }}
{ "serverVersion"(String):, "userCount_str"(String):, "userCount"(Integer):, "serverName"(String:), "serviceStatus"(String): , "constellations":{"href"(String):}, "itemGroups":{"href"(String):}, "corporations":{"href"(String):}, "alliances":{"href"(String):}, "decode":{"href"(String):}, "marketPrices":{"href"(String):}, "opportunities":{"href"(String):, "tasks":{ "href"(String): }, "groups:{ "href"(String): } }, "itemCategories":{"href"(String):}, "regions":{"href"(String):}, "bloodlines":{"href"(String):}, "marketGroups":{"href"(String):}, "systems":{"href"(String):}, "sovereignty":{"href"(String):, "campaigns":{"href"(String):}, "structures":{"href"(String):}}, "tournaments":{"href"(String):}, "virtualGoodStore":{"href"(String):}, "wars":{"href"(String):}, "incursions":{"href"(String):}, "dogma":{"href"(String):, "attributes":{"href"(String):}, "effects":{"href"(String):}}, "races":{"href"(String):}, "insurancePrices":{"href"(String):}, "authEndpoint":{"href"(String):}, "itemGroups":{"href"(String):}, "industry":{"href"(String):, "facilities":{"href"(String):}, "systems":{"href"(String):}}, "npcCorporations":{"href"(String):}, "time":{"href"(String):}, }
Application object var endpoints type is of EndpointsEndpoints object var serverName type is of String var List of type is of EndpointGroupEndpointGroup object var groupName type is of String var List of type is of Endpoint Endpoint object var name type is of String var uri type is of String // to accessendpoints.List[i].groupName.List[j].uri
Application object var map type is of HashMapHashMap object var key type is of String var key type is of no-type, or auto-type//to accessif HashMap of HashMapsmap["wellKnownLabel-level3"].map["wellknownLabel-level2"].map["wellknownLabel-level1"] ...if single HashMapkey = WellKnownLabel-level1 + "." + WellKnownLabel-level3 + "." WellKnownLabel-Level3map[key ]
{ "serverName": "TRANQUILITY", "serverVersion": "EVE-TRANQUILITY 14.07.1066627.1066627", "userCount_str": "25155", "serviceStatus": "online", [ ..., {"groupName": "industry", [ {"name": "facilities", "uri": "https://crest-tq.eveonline.com/industry/facilities/"}, {"name": "systems", "uri": "https://crest-tq.eveonline.com/industry/systems/"} ] }, {"groupName": "npcCorporations", [{"name": "npccorps", "uri": "https://crest-tq.eveonline.com/corporations/npccorps/"}] }, ... ]}
Trade Hub Price Checker: stop.hammerti.me.uk/pricecheck
Visit "Haulers Channel" in game for all matters courier-related.
Structure name/system API: stop.hammerti.me.uk/api
defstruct Node_JSON key Type(String) : Value Type(Hashmap of Node_JSON | Array of Node_JSON | String | Boolean | Number | null)defstruct JSON Hashmap Type(NodeJSON)
your_parsed_JSON["key"]
A VehicleA Car isa Vehicle A EngineA FourCylinder isa EngineA Car hasa engineA Ford isa CarA Fiesta isa FordA Fiesta hasa FourCylinderetc.
Crest hasa GroupedEndpoints - 1:many GroupedEndpoints hasa name hasa Endpoint -1:many Endpoint hasa name hasa uri hasa Endpoint 1:many
{"industry": { "facilities": { "href": "https://crest-tq.eveonline.com/industry/facilities/" }, "systems": { "href": "https://crest-tq.eveonline.com/industry/systems/" }},}
Gson gson = new Gson(); // get the google json parser CrestCallTree root = gson.fromJson(jsonBody, CrestCallTree.clazz); // use gson to parse jsonBody into CrestCallTree object EndpointGroup endpointGroup = root.endpointGroups.get("industry"); // get the industry call group Endpoint endpoint = endpointGroup.get("systems"); // we now have root.industry.endpoint logger.info(endpointGroup.groupName + "." + endpoint.name + ".url = " + endpoint.url); // result , "industry.systems = https://crest-tq.eveonline.com/industry/systems/" is logged.