Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

jsonStringToMap

public static Map<String, String> jsonStringToMap(String str) throws JSONException {
        HashMap hashMap = new HashMap();
        if (TextUtils.isEmpty(str)) {
            return hashMap;
        }
        JSONObject jSONObject = (JSONObject) new JSONTokener(str).nextValue();
        Iterator<String> keys = jSONObject.keys();
        while (keys.hasNext()) {
            String next = keys.next();
            hashMap.put(next, jSONObject.getString(next));
        }
        return hashMap;
    }
Comment

PREVIOUS NEXT
Code Example
Java :: jframe open another frame using button actionlistener 
Java :: print map in java log 
Java :: tomcat allow remote access to manager 
Java :: jagermeister price in bangalore 
Java :: javafx stage always on top 
Java :: join table in where clause criteria in java hibernate 
Java :: illmatic 
Java :: How to Fix java.lang.UnsupportedClassVersionError 
Java :: java check if a line is enclosed in quotation marks 
Java :: android loop through string array 
Java :: java active displays 
Java :: crazy error 
Java :: Java Single-line Comment 
Java :: least significant bit java 
Java :: how to make 2 nested loops to count to 100 
Java :: problemi arrayList javafx 
Java :: java list to collections 
Java :: spring media part max size 
Java :: Java assertion with expression example 
Java :: class BuildConfig is public, should be declared in a file named BuildConfig.java 
Java :: TestNG Data Provider example 
Java :: your application is missing a valid safety identifier 
Java :: code converter python to java 
Java :: how to set background color in jframe in java 
Java :: spigot give item 
Java :: Draw an item using System.out.println 
Java :: spring security not going to logout success urk 
Java :: Android equivalent of getElementById 
Java :: change replication factor hadoop cluster command 
Java :: ConnectionString connection timeOut mongodb java 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =