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


Java StringWrapper類代碼示例

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


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

示例1: makeLoginUrl

import org.ofbiz.base.util.StringUtil.StringWrapper; //導入依賴的package包/類
public static StringWrapper makeLoginUrl(HttpServletRequest request, String requestName) {
    Map<String, Object> urlParams = UtilHttp.getUrlOnlyParameterMap(request);
    String queryString = UtilHttp.urlEncodeArgs(urlParams);
    String currentView = UtilFormatOut.checkNull((String) request.getAttribute("_CURRENT_VIEW_"));

    String loginUrl = "/" + requestName;
    if ("login".equals(currentView)) {
        return StringUtil.wrapString(loginUrl);
    }
    if (UtilValidate.isNotEmpty(currentView)) {
        loginUrl += "/" + currentView;
    }
    if (UtilValidate.isNotEmpty(queryString)) {
        loginUrl += "?" + queryString;
    }

    return StringUtil.wrapString(loginUrl);
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:19,代碼來源:LoginWorker.java

示例2: makeProductUrl

import org.ofbiz.base.util.StringUtil.StringWrapper; //導入依賴的package包/類
public static String makeProductUrl(Delegator delegator, ProductContentWrapper wrapper,List<String> trail, String contextPath, String previousCategoryId, String productCategoryId, String productId) {
    String url = "";
    StringWrapper alternativeUrl = wrapper.get("ALTERNATIVE_URL");
    if (UtilValidate.isNotEmpty(alternativeUrl) && UtilValidate.isNotEmpty(alternativeUrl.toString())) {
        StringBuilder urlBuilder = new StringBuilder();
        urlBuilder.append(contextPath);
        if (urlBuilder.length() == 0 || urlBuilder.charAt(urlBuilder.length() - 1) != '/') {
            urlBuilder.append("/");
        }
        // append alternative URL
        url = UrlServletHelper.invalidCharacter(alternativeUrl.toString());
        urlBuilder.append(url);
        if (UtilValidate.isNotEmpty(productId)) {
            urlBuilder.append("-");
            urlBuilder.append(productId);
            urlBuilder.append("-p");
        }
        url = urlBuilder.toString();
    } else {
        if(UtilValidate.isEmpty(trail)){
            trail = FastList.newInstance();
        }
        url = CatalogUrlServlet.makeCatalogUrl(contextPath, trail, productId, productCategoryId, previousCategoryId);
    }
    return url;
}
 
開發者ID:gildaslemoal,項目名稱:elpi,代碼行數:27,代碼來源:CatalogUrlFilter.java

示例3: makeProductUrl

import org.ofbiz.base.util.StringUtil.StringWrapper; //導入依賴的package包/類
public static String makeProductUrl(Delegator delegator, ProductContentWrapper wrapper,List<String> trail, String contextPath, String previousCategoryId, String productCategoryId, String productId) {
    String url = "";
    StringWrapper alternativeUrl = wrapper.get("ALTERNATIVE_URL");
    if (UtilValidate.isNotEmpty(alternativeUrl) && UtilValidate.isNotEmpty(alternativeUrl.toString())) {
        StringBuilder urlBuilder = new StringBuilder();
        urlBuilder.append(contextPath);
        if (urlBuilder.charAt(urlBuilder.length() - 1) != '/') {
            urlBuilder.append("/");
        }
        // append alternative URL
        url = UrlServletHelper.invalidCharacter(alternativeUrl.toString());
        urlBuilder.append(url);
        if (UtilValidate.isNotEmpty(productId)) {
            urlBuilder.append("-");
            urlBuilder.append(productId);
            urlBuilder.append("-p");
        }
        url = urlBuilder.toString();
    } else {
        if(UtilValidate.isEmpty(trail)){
            trail = FastList.newInstance();
        }
        url = CatalogUrlServlet.makeCatalogUrl(contextPath, trail, productId, productCategoryId, previousCategoryId);
    }
    return url;
}
 
開發者ID:jamesyong,項目名稱:o3erp,代碼行數:27,代碼來源:CatalogUrlFilter.java

示例4: makeCategoryUrl

import org.ofbiz.base.util.StringUtil.StringWrapper; //導入依賴的package包/類
public static String makeCategoryUrl(Delegator delegator, CategoryContentWrapper wrapper, List<String> trail, String contextPath, String previousCategoryId, String productCategoryId, String productId, String viewSize, String viewIndex, String viewSort, String searchString) {
    String url = "";
    StringWrapper alternativeUrl = wrapper.get("ALTERNATIVE_URL");
    
    if (UtilValidate.isNotEmpty(alternativeUrl) && UtilValidate.isNotEmpty(alternativeUrl.toString())) {
        StringBuilder urlBuilder = new StringBuilder();
        urlBuilder.append(contextPath);
        if (urlBuilder.length() == 0 || urlBuilder.charAt(urlBuilder.length() - 1) != '/') {
            urlBuilder.append("/");
        }
        // append alternative URL
        url = UrlServletHelper.invalidCharacter(alternativeUrl.toString());
        urlBuilder.append(url);
        if (UtilValidate.isNotEmpty(productCategoryId)) {
            urlBuilder.append("-");
            urlBuilder.append(productCategoryId);
            urlBuilder.append("-c");
        }
        // append view index
        if (UtilValidate.isNotEmpty(viewIndex)) {
            if (!urlBuilder.toString().endsWith("?") && !urlBuilder.toString().endsWith("&")) {
                urlBuilder.append("?");
            }
            urlBuilder.append("viewIndex=" + viewIndex + "&");
        }
        // append view size
        if (UtilValidate.isNotEmpty(viewSize)) {
            if (!urlBuilder.toString().endsWith("?") && !urlBuilder.toString().endsWith("&")) {
                urlBuilder.append("?");
            }
            urlBuilder.append("viewSize=" + viewSize + "&");
        }
        // append view sort
        if (UtilValidate.isNotEmpty(viewSort)) {
            if (!urlBuilder.toString().endsWith("?") && !urlBuilder.toString().endsWith("&")) {
                urlBuilder.append("?");
            }
            urlBuilder.append("viewSort=" + viewSort + "&");
        }
        // append search string
        if (UtilValidate.isNotEmpty(searchString)) {
            if (!urlBuilder.toString().endsWith("?") && !urlBuilder.toString().endsWith("&")) {
                urlBuilder.append("?");
            }
            urlBuilder.append("searchString=" + searchString + "&");
        }
        if (urlBuilder.toString().endsWith("&")) {
            return urlBuilder.toString().substring(0, urlBuilder.toString().length()-1);
        }
        
        url = urlBuilder.toString();
    } else {
        if(UtilValidate.isEmpty(trail)){
            trail = FastList.newInstance();
        }
        url = CatalogUrlServlet.makeCatalogUrl(contextPath, trail, productId, productCategoryId, previousCategoryId);
    }
    
    return url;
}
 
開發者ID:gildaslemoal,項目名稱:elpi,代碼行數:61,代碼來源:CatalogUrlFilter.java

示例5: makeCategoryUrl

import org.ofbiz.base.util.StringUtil.StringWrapper; //導入依賴的package包/類
public static String makeCategoryUrl(Delegator delegator, CategoryContentWrapper wrapper, List<String> trail, String contextPath, String previousCategoryId, String productCategoryId, String productId, String viewSize, String viewIndex, String viewSort, String searchString) {
    String url = "";
    StringWrapper alternativeUrl = wrapper.get("ALTERNATIVE_URL");
    
    if (UtilValidate.isNotEmpty(alternativeUrl) && UtilValidate.isNotEmpty(alternativeUrl.toString())) {
        StringBuilder urlBuilder = new StringBuilder();
        urlBuilder.append(contextPath);
        if (urlBuilder.charAt(urlBuilder.length() - 1) != '/') {
            urlBuilder.append("/");
        }
        // append alternative URL
        url = UrlServletHelper.invalidCharacter(alternativeUrl.toString());
        urlBuilder.append(url);
        if (UtilValidate.isNotEmpty(productCategoryId)) {
            urlBuilder.append("-");
            urlBuilder.append(productCategoryId);
            urlBuilder.append("-c");
        }
        // append view index
        if (UtilValidate.isNotEmpty(viewIndex)) {
            if (!urlBuilder.toString().endsWith("?") && !urlBuilder.toString().endsWith("&")) {
                urlBuilder.append("?");
            }
            urlBuilder.append("viewIndex=" + viewIndex + "&");
        }
        // append view size
        if (UtilValidate.isNotEmpty(viewSize)) {
            if (!urlBuilder.toString().endsWith("?") && !urlBuilder.toString().endsWith("&")) {
                urlBuilder.append("?");
            }
            urlBuilder.append("viewSize=" + viewSize + "&");
        }
        // append view sort
        if (UtilValidate.isNotEmpty(viewSort)) {
            if (!urlBuilder.toString().endsWith("?") && !urlBuilder.toString().endsWith("&")) {
                urlBuilder.append("?");
            }
            urlBuilder.append("viewSort=" + viewSort + "&");
        }
        // append search string
        if (UtilValidate.isNotEmpty(searchString)) {
            if (!urlBuilder.toString().endsWith("?") && !urlBuilder.toString().endsWith("&")) {
                urlBuilder.append("?");
            }
            urlBuilder.append("searchString=" + searchString + "&");
        }
        if (urlBuilder.toString().endsWith("&")) {
            return urlBuilder.toString().substring(0, urlBuilder.toString().length()-1);
        }
        
        url = urlBuilder.toString();
    } else {
        if(UtilValidate.isEmpty(trail)){
            trail = FastList.newInstance();
        }
        url = CatalogUrlServlet.makeCatalogUrl(contextPath, trail, productId, productCategoryId, previousCategoryId);
    }
    
    return url;
}
 
開發者ID:jamesyong,項目名稱:o3erp,代碼行數:61,代碼來源:CatalogUrlFilter.java


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