2033 |
aurelien |
1 |
package org.tela_botanica.client.modeles.objets;
|
|
|
2 |
|
|
|
3 |
import java.util.HashMap;
|
|
|
4 |
import java.util.Iterator;
|
|
|
5 |
|
|
|
6 |
import com.google.gwt.json.client.JSONObject;
|
|
|
7 |
import com.google.gwt.json.client.JSONParser;
|
|
|
8 |
import com.google.gwt.json.client.JSONValue;
|
|
|
9 |
import com.google.gwt.user.client.Window;
|
|
|
10 |
|
|
|
11 |
public class ListeChampsEtendus extends HashMap<String, String> {
|
|
|
12 |
|
|
|
13 |
public ListeChampsEtendus(String listeChampsEtendusJson) {
|
|
|
14 |
super();
|
|
|
15 |
final JSONValue responseValue = JSONParser.parse(listeChampsEtendusJson);
|
|
|
16 |
|
|
|
17 |
JSONObject reponse = null;
|
|
|
18 |
|
|
|
19 |
// si c'est un objet
|
|
|
20 |
if ((reponse = responseValue.isObject()) != null) {
|
|
|
21 |
Iterator<String> it = reponse.keySet().iterator();
|
|
|
22 |
|
|
|
23 |
while(it.hasNext()) {
|
|
|
24 |
String cle = it.next();
|
|
|
25 |
String valeur = reponse.get(cle).isString().stringValue();
|
|
|
26 |
this.put(cle, valeur);
|
|
|
27 |
}
|
|
|
28 |
}
|
|
|
29 |
}
|
|
|
30 |
}
|