1,8 → 1,5 |
package org.tela_botanica.del.client.utils; |
|
import java.util.HashMap; |
import java.util.Map; |
|
import com.google.gwt.http.client.Response; |
import com.google.gwt.json.client.JSONArray; |
import com.google.gwt.json.client.JSONObject; |
31,21 → 28,6 |
return chaineTraitee; |
} |
|
public static Map<String, String> extraireTaxonsNumNomsResultatRetourSimple(Response response) { |
JSONObject responseValue = JSONParser.parseStrict(response.getText()).isObject(); |
JSONArray noms = responseValue.get("resultats").isArray(); |
|
final int taillemax = noms.size(); |
Map<String, String> retourTaxons = new HashMap<String, String>(taillemax); |
|
for (int i = 0; i < taillemax; i++) { |
String nom = (noms.get(i).isArray().get(0).isString().stringValue()); |
String taxon = (noms.get(i).isArray().get(1).isString().stringValue()); |
retourTaxons.put(nom, taxon); |
} |
return retourTaxons; |
} |
|
public static String[] parserResultatRetourSimple(Response response) { |
JSONObject responseValue = JSONParser.parseStrict(response.getText()).isObject(); |
JSONArray noms = responseValue.get("resultats").isArray(); |