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


Java StringUtils.isEmpty方法代碼示例

本文整理匯總了Java中org.hibernate.tool.hbm2x.StringUtils.isEmpty方法的典型用法代碼示例。如果您正苦於以下問題:Java StringUtils.isEmpty方法的具體用法?Java StringUtils.isEmpty怎麽用?Java StringUtils.isEmpty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.hibernate.tool.hbm2x.StringUtils的用法示例。


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

示例1: update

import org.hibernate.tool.hbm2x.StringUtils; //導入方法依賴的package包/類
@Override
public Entity update(PersistencePackage persistencePackage, DynamicEntityDao dynamicEntityDao, RecordHelper helper) throws ServiceException {
    Entity entity = persistencePackage.getEntity();
    Customer customer = customerService.readCustomerByUsername(entity.findProperty("username").getValue());
    if (StringUtils.isEmpty(customer.getEmailAddress())) {
        throw new ServiceException("Unable to update password because an email address is not available for this customer. An email address is required to send the customer the new system generated password.");
    }
    
    PasswordReset passwordReset = new PasswordReset();
    passwordReset.setUsername(entity.findProperty("username").getValue());
    passwordReset.setPasswordChangeRequired(false);
    passwordReset.setEmail(customer.getEmailAddress());
    passwordReset.setPasswordLength(22);
    passwordReset.setSendResetEmailReliableAsync(false);
    
    customer = customerService.resetPassword(passwordReset);
    
    return entity;
}
 
開發者ID:passion1014,項目名稱:metaworks_framework,代碼行數:20,代碼來源:CustomerPasswordCustomPersistenceHandler.java

示例2: getSiteMapFileName

import org.hibernate.tool.hbm2x.StringUtils; //導入方法依賴的package包/類
@Override
public String getSiteMapFileName() {
    if (StringUtils.isEmpty(siteMapFileName)) {
        return DEFAULT_SITE_MAP_FILE_NAME;
    } else {
        return siteMapFileName;
    }
}
 
開發者ID:passion1014,項目名稱:metaworks_framework,代碼行數:9,代碼來源:SiteMapConfigurationImpl.java

示例3: getIndexedSiteMapFileName

import org.hibernate.tool.hbm2x.StringUtils; //導入方法依賴的package包/類
@Override
public String getIndexedSiteMapFileName() {
    if (StringUtils.isEmpty(indexedSiteMapFileName)) {
        return getSiteMapFileName();
    }
    return indexedSiteMapFileName;
}
 
開發者ID:passion1014,項目名稱:metaworks_framework,代碼行數:8,代碼來源:SiteMapConfigurationImpl.java

示例4: getSiteMapIndexFilePattern

import org.hibernate.tool.hbm2x.StringUtils; //導入方法依賴的package包/類
@Override
public String getSiteMapIndexFilePattern() {
    if (!StringUtils.isEmpty(indexedSiteMapFilePattern) &&
            indexedSiteMapFilePattern.contains("###")) {
        return indexedSiteMapFilePattern;
    }

    String siteMapFileName = getSiteMapFileName();
    int pos = siteMapFileName.indexOf(".xml");
    if (pos > 0) {
        return siteMapFileName.substring(0, pos) + "###" + siteMapFileName.substring(pos);
    } else {
        return "sitemap###.xml";
    }
}
 
開發者ID:passion1014,項目名稱:metaworks_framework,代碼行數:16,代碼來源:SiteMapConfigurationImpl.java

示例5: addSiteMapEntries

import org.hibernate.tool.hbm2x.StringUtils; //導入方法依賴的package包/類
@Override
public void addSiteMapEntries(SiteMapGeneratorConfiguration smgc, SiteMapBuilder siteMapBuilder) {

    int pageNum = 0;
    List<Product> products;

    do {
        products = productDao.readAllActiveProducts(pageNum++, pageSize);
        for (Product product : products) {
            if (StringUtils.isEmpty(product.getUrl())) {
                continue;
            }

            SiteMapURLWrapper siteMapUrl = new SiteMapURLWrapper();

            // location
            siteMapUrl.setLoc(generateUri(siteMapBuilder, product));

            // change frequency
            siteMapUrl.setChangeFreqType(smgc.getSiteMapChangeFreq());

            // priority
            siteMapUrl.setPriorityType(smgc.getSiteMapPriority());

            // lastModDate
            siteMapUrl.setLastModDate(generateDate(product));

            siteMapBuilder.addUrl(siteMapUrl);
        }
    } while (products.size() == pageSize);

}
 
開發者ID:passion1014,項目名稱:metaworks_framework,代碼行數:33,代碼來源:ProductSiteMapGenerator.java

示例6: addCategorySiteMapEntries

import org.hibernate.tool.hbm2x.StringUtils; //導入方法依賴的package包/類
protected void addCategorySiteMapEntries(Category parentCategory, int currentDepth, CategorySiteMapGeneratorConfiguration categorySMGC, SiteMapBuilder siteMapBuilder) {
    
    int rowOffset = 0;
    List<Category> categories;
    
    do {
        categories = categoryDao.readActiveSubCategoriesByCategory(parentCategory, rowLimit, rowOffset);
        rowOffset += categories.size();
        for (Category category : categories) {
            if (StringUtils.isEmpty(category.getUrl())) {
                continue;
            }

            if (currentDepth < categorySMGC.getEndingDepth()) {
                addCategorySiteMapEntries(category, currentDepth + 1, categorySMGC, siteMapBuilder);
            }

            if (currentDepth < categorySMGC.getStartingDepth()) {
                continue;
            }
            
            SiteMapURLWrapper siteMapUrl = new SiteMapURLWrapper();

            // location
            siteMapUrl.setLoc(generateUri(siteMapBuilder, category));

            // change frequency
            siteMapUrl.setChangeFreqType(categorySMGC.getSiteMapChangeFreq());

            // priority
            siteMapUrl.setPriorityType(categorySMGC.getSiteMapPriority());

            // lastModDate
            siteMapUrl.setLastModDate(generateDate(category));

            siteMapBuilder.addUrl(siteMapUrl);
        }
    } while (categories.size() == rowLimit);

}
 
開發者ID:passion1014,項目名稱:metaworks_framework,代碼行數:41,代碼來源:CategorySiteMapGenerator.java

示例7: couldOfferApplyToCustomer

import org.hibernate.tool.hbm2x.StringUtils; //導入方法依賴的package包/類
/**
 * Private method which executes the appliesToCustomerRules in the Offer to determine if this Offer
 * can be applied to the Customer.
 *
 * @param offer
 * @param customer
 * @return true if offer can be applied, otherwise false
 */
protected boolean couldOfferApplyToCustomer(Offer offer, Customer customer) {
    boolean appliesToCustomer = false;
    
    String rule = null;
    if (!StringUtils.isEmpty(offer.getAppliesToCustomerRules())) {
        rule = offer.getAppliesToCustomerRules();
    } else {
        OfferRule customerRule = offer.getOfferMatchRules().get(OfferRuleType.CUSTOMER.getType());
        if (customerRule != null) {
            rule = customerRule.getMatchRule();
        }
    }

    if (rule != null) {
        HashMap<String, Object> vars = new HashMap<String, Object>();
        vars.put("customer", customer);
        Boolean expressionOutcome = executeExpression(rule, vars);
        if (expressionOutcome != null && expressionOutcome) {
            appliesToCustomer = true;
        }
    } else {
        appliesToCustomer = true;
    }

    return appliesToCustomer;
}
 
開發者ID:passion1014,項目名稱:metaworks_framework,代碼行數:35,代碼來源:AbstractBaseProcessor.java


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