Subversion Repositories eFlore/Applications.del

Compare Revisions

Ignore whitespace Rev 938 → Rev 1256

/trunk/src/org/tela_botanica/del/client/utils/UtilitairesAutoCompletionService.java
1,5 → 1,8
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;
28,6 → 31,21
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();