I’m having problem with these elemental json, and I cant find documentation of how to use these clases, only the api, that are not very clear.
I changed all my old JSONArray and JSONObject to the elemental.JsonObject and elemental.JsonArray, but Im having these errors trying to get the values from json objects or from arrays:
elemental.json.impl.JreJsonString cannot be cast to elemental.json.JsonArray
here is my code:
public void sortArrayReceived(JsonArray a) {
ArrayList<CategoriaItem> items = new ArrayList<CategoriaItem>();
//this print the json array as espected...
System.out.println("array:" + a.asString());
try {
for (int index = 0; index < a.length(); index++) {
CategoriaItem item = new CategoriaItem();
//here I got the exception...
JsonObject o = a.getObject(index);
item.setIdarticulo( Utils.parseInt( o.getString("sku"), 0 ) );
PD. I need some help here, I only have access to the project code 4 - 5 hours at week . (Some security thing at the company) , and these changes supposedly were quick to implement.