/** * Parses the key and creates the child QueryParamMaps * user[info][name] creates 3 nested QueryParamMaps. For user, info and * name. * * @param key The key in the formar fo key1[key2][key3] (for example: * user[info][name]). * @param values the values */ protected QueryParamsMap(String key, String... values) { loadKeys(key, values); }
/** * loads query string * * @param params the parameters */ protected final void loadQueryString(Map<String, String[]> params) { for (Map.Entry<String, String[]> param : params.entrySet()) { loadKeys(param.getKey(), param.getValue()); } }
/** * loads keys * * @param key the key * @param value the values */ protected final void loadKeys(String key, String[] value) { String[] parsed = parseKey(key); if (parsed == null) { return; } if (!queryMap.containsKey(parsed[0])) { queryMap.put(parsed[0], new QueryParamsMap()); } if (!parsed[1].isEmpty()) { queryMap.get(parsed[0]).loadKeys(parsed[1], value); } else { queryMap.get(parsed[0]).values = value.clone(); } }
/** * Parses the key and creates the child QueryParamMaps * user[info][name] creates 3 nested QueryParamMaps. For user, info and * name. * * @param key The key in the formar fo key1[key2][key3] (for example: * user[info][name]). * @param values the values */ protected QueryParamsMap(String key, String... values) { loadKeys(key, values); }
/** * Parses the key and creates the child QueryParamMaps * * user[info][name] creates 3 nested QueryParamMaps. For user, info and * name. * * @param key * The key in the formar fo key1[key2][key3] (for example: * user[info][name]). * @param values */ protected QueryParamsMap(String key, String... values) { loadKeys(key, values); }
protected final void loadQueryString(Map<String, String[]> params) { for (Map.Entry<String, String[]> param : params.entrySet()) { loadKeys(param.getKey(), param.getValue()); } }
/** * loads query string * * @param params the parameters */ protected final void loadQueryString(Map<String, String[]> params) { for (Map.Entry<String, String[]> param : params.entrySet()) { loadKeys(param.getKey(), param.getValue()); } }
protected final void loadKeys(String key, String[] value) { String[] parsed = parseKey(key); if(parsed == null) { return; } if(!queryMap.containsKey(parsed[0])) { queryMap.put(parsed[0], new QueryParamsMap()); } if(!parsed[1].isEmpty()) { queryMap.get(parsed[0]).loadKeys(parsed[1], value); } else { queryMap.get(parsed[0]).values = value.clone(); } }
/** * loads keys * * @param key the key * @param value the values */ protected final void loadKeys(String key, String[] value) { String[] parsed = parseKey(key); if (parsed == null) { return; } if (!queryMap.containsKey(parsed[0])) { queryMap.put(parsed[0], new QueryParamsMap()); } if (!parsed[1].isEmpty()) { queryMap.get(parsed[0]).loadKeys(parsed[1], value); } else { queryMap.get(parsed[0]).values = value.clone(); } }