code: public static Map<String, String> convertJsObjectToMap(JavaScriptObject jso) {
  
          Map<String, String> result = new HashMap<String, String>();
          JSONObject json = new JSONObject(jso);
          for (String key : json.keySet()) {
              if ((json.get(key) != null) && (json.get(key).isString() != null)) {
                  result.put(key, json.get(key).isString().stringValue());
              } else {
                  result.put(key, null);
              }
          }
          return result;
      }
docs: Converts a Javascript object to a map from strings to strings, ignoring all properties
  of the object whose value is not a string.<p>
  
  @param jso the Javascript object to convert
  @return the map containing the string-valued properties of the Javascript object