本文整理匯總了Java中org.hibernate.tool.hbm2x.StringUtils類的典型用法代碼示例。如果您正苦於以下問題:Java StringUtils類的具體用法?Java StringUtils怎麽用?Java StringUtils使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
StringUtils類屬於org.hibernate.tool.hbm2x包,在下文中一共展示了StringUtils類的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;
}
}
示例3: getIndexedSiteMapFileName
import org.hibernate.tool.hbm2x.StringUtils; //導入依賴的package包/類
@Override
public String getIndexedSiteMapFileName() {
if (StringUtils.isEmpty(indexedSiteMapFileName)) {
return getSiteMapFileName();
}
return indexedSiteMapFileName;
}
示例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";
}
}
示例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);
}
示例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);
}
示例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;
}