當前位置: 首頁>>代碼示例>>Java>>正文


Java ParamUtil類代碼示例

本文整理匯總了Java中com.feilong.core.net.ParamUtil的典型用法代碼示例。如果您正苦於以下問題:Java ParamUtil類的具體用法?Java ParamUtil怎麽用?Java ParamUtil使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ParamUtil類屬於com.feilong.core.net包,在下文中一共展示了ParamUtil類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getQueryStringLog

import com.feilong.core.net.ParamUtil; //導入依賴的package包/類
/**
 * 獲取queryString (支持 post/get).
 *
 * @return the query string
 * @see javax.servlet.http.HttpServletRequest#getMethod()
 */
private String getQueryStringLog(){
    // Returns the name of the HTTP method with which this request was made,
    // for example, GET, POST, or PUT.
    // Same as the value of the CGI variable REQUEST_METHOD.
    String method = request.getMethod();

    if ("post".equalsIgnoreCase(method)){
        Map<String, String[]> map = RequestUtil.getParameterMap(request);
        if (isNotNullOrEmpty(map)){
            return ParamUtil.toQueryStringUseArrayValueMap(map);
        }
    }
    // Returns the query string that is contained in the request URL after the path.
    // This method returns null if the URL does not have a query string.
    // Same as the value of the CGI variable QUERY_STRING.
    // 它隻對get方法得到的數據有效.
    return request.getQueryString();
}
 
開發者ID:venusdrogon,項目名稱:feilong-servlet,代碼行數:25,代碼來源:RequestLogBuilder.java

示例2: toNavigationPageNumberMap

import com.feilong.core.net.ParamUtil; //導入依賴的package包/類
/**
 * 轉成導航頁碼的map.
 *
 * @param dynamicNavigationPageNumberConfig
 *            the dynamic navigation page number config
 * @return the map
 */
private static Map<Integer, Integer> toNavigationPageNumberMap(String dynamicNavigationPageNumberConfig){
    // 1 將字符串轉成 map Map<String, String>
    Map<String, String> singleValueMap = ParamUtil.toSingleValueMap(dynamicNavigationPageNumberConfig, UTF8);

    // 2 轉成 Map<Integer, Integer>
    Map<Integer, Integer> integerMap = toMap(singleValueMap, Integer.class, Integer.class);

    //3  排序
    return sortMapByKeyDesc(integerMap);
}
 
開發者ID:venusdrogon,項目名稱:feilong-taglib,代碼行數:18,代碼來源:PagerCacheContentBuilder.java

示例3: testJoinSingleValueMap2

import com.feilong.core.net.ParamUtil; //導入依賴的package包/類
/**
 * Test join single value map 2.
 */
@Test
public void testJoinSingleValueMap2(){
    Map<String, String> map = newLinkedHashMap();
    map.put(null, null);
    map.put("a", "");
    map.put("b", null);
    map.put("c", "jim");

    assertEquals("=&a=&b=&c=jim", ParamUtil.toQueryStringUseSingleValueMap(map));
}
 
開發者ID:venusdrogon,項目名稱:feilong-core,代碼行數:14,代碼來源:ToQueryStringUseSingleValueMapTest.java

示例4: testJoinSingleValueMap1

import com.feilong.core.net.ParamUtil; //導入依賴的package包/類
/**
 * Test join single value map1.
 */
@Test
public void testJoinSingleValueMap1(){
    Map<String, String> singleValueMap = newLinkedHashMap();

    singleValueMap.put("province", "江蘇省");
    singleValueMap.put("city", "南通市");

    assertEquals("province=江蘇省&city=南通市", ParamUtil.toQueryStringUseSingleValueMap(singleValueMap));
}
 
開發者ID:venusdrogon,項目名稱:feilong-core,代碼行數:13,代碼來源:ToQueryStringUseSingleValueMapTest.java

示例5: testToNaturalOrderingString

import com.feilong.core.net.ParamUtil; //導入依賴的package包/類
/**
 * Test to natural ordering string.
 */
@Test
public void testToNaturalOrderingString(){
    Map<String, String> map = newHashMap();
    map.put("service", "create_salesorder");
    map.put("_input_charset", "gbk");
    map.put("totalActual", "210.00");
    map.put("address", "江蘇南通市通州區888組888號");

    assertEquals(
                    "_input_charset=gbk&address=江蘇南通市通州區888組888號&service=create_salesorder&totalActual=210.00",
                    ParamUtil.toNaturalOrderingQueryString(map));
}
 
開發者ID:venusdrogon,項目名稱:feilong-core,代碼行數:16,代碼來源:ToNaturalOrderingQueryStringTest.java

示例6: testToNaturalOrderingStringNullValue

import com.feilong.core.net.ParamUtil; //導入依賴的package包/類
/**
 * Test to natural ordering string 3.
 */
@Test
public void testToNaturalOrderingStringNullValue(){
    Map<String, String> map = newHashMap();
    map.put("service", null);
    map.put("totalActual", "210.00");
    map.put("province", "江蘇省");
    assertEquals("province=江蘇省&service=&totalActual=210.00", ParamUtil.toNaturalOrderingQueryString(map));
}
 
開發者ID:venusdrogon,項目名稱:feilong-core,代碼行數:12,代碼來源:ToNaturalOrderingQueryStringTest.java

示例7: testToNaturalOrderingStringNullKey

import com.feilong.core.net.ParamUtil; //導入依賴的package包/類
/**
 * Test to natural ordering string null key.
 */
@Test
public void testToNaturalOrderingStringNullKey(){
    Map<String, String> map = newHashMap();
    map.put("totalActual", null);
    map.put(null, "create_salesorder");
    map.put("province", "江蘇省");
    assertEquals("=create_salesorder&province=江蘇省&totalActual=", ParamUtil.toNaturalOrderingQueryString(map));
}
 
開發者ID:venusdrogon,項目名稱:feilong-core,代碼行數:12,代碼來源:ToNaturalOrderingQueryStringTest.java

示例8: testJoinValuesTwoKeys

import com.feilong.core.net.ParamUtil; //導入依賴的package包/類
/**
 * Test join values two keys.
 */
@Test
public void testJoinValuesTwoKeys(){
    Map<String, String> map = toMap("service", "create_salesorder", "paymentType", "unionpay_mobile");
    assertEquals("create_salesorder" + "unionpay_mobile", ParamUtil.joinValuesOrderByIncludeKeys(map, "service", "paymentType"));
    assertEquals("unionpay_mobile" + "create_salesorder", ParamUtil.joinValuesOrderByIncludeKeys(map, "paymentType", "service"));
}
 
開發者ID:venusdrogon,項目名稱:feilong-core,代碼行數:10,代碼來源:JoinValuesOrderByIncludeKeysTest.java

示例9: testJoinArrayValueMap

import com.feilong.core.net.ParamUtil; //導入依賴的package包/類
/**
 * Test join array value map.
 */
@Test
public void testJoinArrayValueMap(){
    Map<String, String[]> keyAndArrayMap = newLinkedHashMap();

    keyAndArrayMap.put("province", new String[] { "江蘇省", "浙江省" });
    keyAndArrayMap.put("city", new String[] { "南通市" });

    assertEquals("province=江蘇省&province=浙江省&city=南通市", ParamUtil.toQueryStringUseArrayValueMap(keyAndArrayMap));
}
 
開發者ID:venusdrogon,項目名稱:feilong-core,代碼行數:13,代碼來源:ToQueryStringUseArrayValueMapTest.java

示例10: testJoinArrayValueMapNullElement

import com.feilong.core.net.ParamUtil; //導入依賴的package包/類
/**
 * Test join array value map null element.
 */
@Test
public void testJoinArrayValueMapNullElement(){
    Map<String, String[]> keyAndArrayMap = newLinkedHashMap();

    keyAndArrayMap.put("province", new String[] { "江蘇省", null });
    keyAndArrayMap.put("city", new String[] { "南通市" });

    assertEquals("province=江蘇省&province=&city=南通市", ParamUtil.toQueryStringUseArrayValueMap(keyAndArrayMap));
}
 
開發者ID:venusdrogon,項目名稱:feilong-core,代碼行數:13,代碼來源:ToQueryStringUseArrayValueMapTest.java

示例11: testJoinArrayValueMapNullValue

import com.feilong.core.net.ParamUtil; //導入依賴的package包/類
/**
 * Test join array value map null value.
 */
@Test
public void testJoinArrayValueMapNullValue(){
    Map<String, String[]> keyAndArrayMap = newLinkedHashMap();

    keyAndArrayMap.put("province", null);
    keyAndArrayMap.put("city", new String[] { "南通市" });

    assertEquals("province=&city=南通市", ParamUtil.toQueryStringUseArrayValueMap(keyAndArrayMap));
}
 
開發者ID:venusdrogon,項目名稱:feilong-core,代碼行數:13,代碼來源:ToQueryStringUseArrayValueMapTest.java

示例12: testJoinArrayValueMapNullParamAndNullValue

import com.feilong.core.net.ParamUtil; //導入依賴的package包/類
/**
 * Test join array value map null param and null value.
 */
@Test
public void testJoinArrayValueMapNullParamAndNullValue(){
    Map<String, String[]> keyAndArrayMap = newLinkedHashMap();

    keyAndArrayMap.put(null, null);
    keyAndArrayMap.put("city", new String[] { "南通市" });

    assertEquals("=&city=南通市", ParamUtil.toQueryStringUseArrayValueMap(keyAndArrayMap));
}
 
開發者ID:venusdrogon,項目名稱:feilong-core,代碼行數:13,代碼來源:ToQueryStringUseArrayValueMapTest.java

示例13: testToNaturalOrderingKeyJoinValue

import com.feilong.core.net.ParamUtil; //導入依賴的package包/類
@Test
public void testToNaturalOrderingKeyJoinValue(){
    Map<String, String> map = newHashMap();
    map.put("service", "create_salesorder");
    map.put("_input_charset", "gbk");
    map.put("totalActual", "210.00");
    map.put("address", "江蘇南通市通州區888組888號");

    assertEquals(
                    "_input_charsetgbkaddress江蘇南通市通州區888組888號servicecreate_salesordertotalActual210.00",
                    ParamUtil.toNaturalOrderingKeyJoinValue(map));
}
 
開發者ID:venusdrogon,項目名稱:feilong-core,代碼行數:13,代碼來源:ToNaturalOrderingKeyJoinValueTest.java

示例14: testToNaturalOrderingKeyJoinValueNullValue

import com.feilong.core.net.ParamUtil; //導入依賴的package包/類
@Test
public void testToNaturalOrderingKeyJoinValueNullValue(){
    Map<String, String> map = newHashMap();
    map.put("service", null);
    map.put("totalActual", "210.00");
    map.put("province", "江蘇省");
    assertEquals("province江蘇省servicetotalActual210.00", ParamUtil.toNaturalOrderingKeyJoinValue(map));
}
 
開發者ID:venusdrogon,項目名稱:feilong-core,代碼行數:9,代碼來源:ToNaturalOrderingKeyJoinValueTest.java

示例15: testToNaturalOrderingKeyJoinValueNullKey

import com.feilong.core.net.ParamUtil; //導入依賴的package包/類
@Test
public void testToNaturalOrderingKeyJoinValueNullKey(){
    Map<String, String> map = newHashMap();
    map.put("totalActual", null);
    map.put(null, "create_salesorder");
    map.put("province", "江蘇省");
    assertEquals("create_salesorderprovince江蘇省totalActual", ParamUtil.toNaturalOrderingKeyJoinValue(map));
}
 
開發者ID:venusdrogon,項目名稱:feilong-core,代碼行數:9,代碼來源:ToNaturalOrderingKeyJoinValueTest.java


注:本文中的com.feilong.core.net.ParamUtil類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。