public static Map<String,String> jsonToMap(String jsonString){
  Map<String,String> jsonMap=new TreeMap<String,String>();
  try {
    GfJsonObject jsonObject=new GfJsonObject(jsonString);
    Iterator<String> keys=jsonObject.keys();
    while (keys.hasNext()) {
      String key=keys.next();
      jsonMap.put(key,jsonObject.getString(key));
    }
  }
 catch (  GfJsonException e) {
    throw new IllegalArgumentException("Could not convert jsonString : '" + jsonString + "' to map.");
  }
  return jsonMap;
}

public static Map < String , String > jsonToMap ( String jsonString ) { Map < String , String > jsonMap = new TreeMap < String , String > ( ) ; try { GfJsonObject jsonObject = new GfJsonObject ( jsonString ) ; Iterator < String > keys = jsonObject . keys ( ) ; while ( keys . hasNext ( ) ) { String key = keys . next ( ) ; jsonMap . put ( key , jsonObject . getString ( key ) ) ; } } catch ( GfJsonException e ) { throw new IllegalArgumentException ( "Could not convert jsonString : '" + jsonString + "' to map." ) ; } return jsonMap ; }
converts given json string in to a map . refer http : / / www . json . org / to construct a json format .
