Example usage for org.apache.commons.lang StringUtils abbreviate

List of usage examples for org.apache.commons.lang StringUtils abbreviate

Introduction

In this page you can find the example usage for org.apache.commons.lang StringUtils abbreviate.

Prototype

public static String abbreviate(String str, int maxWidth) 

Source Link

Document

Abbreviates a String using ellipses.

Usage

From source file:gov.guilin.plugin.pay99bill.Pay99billPlugin.java

@Override
public Map<String, Object> getParameterMap(String sn, String description, HttpServletRequest request) {
    PluginConfig pluginConfig = getPluginConfig();
    Payment payment = getPayment(sn);// w  w w . ja  v a 2 s . c  o m
    Map<String, Object> parameterMap = new LinkedHashMap<String, Object>();
    parameterMap.put("inputCharset", "1");
    parameterMap.put("pageUrl", getNotifyUrl(sn, NotifyMethod.sync));
    parameterMap.put("bgUrl", getNotifyUrl(sn, NotifyMethod.async));
    parameterMap.put("version", "v2.0");
    parameterMap.put("language", "1");
    parameterMap.put("signType", "1");
    parameterMap.put("merchantAcctId", pluginConfig.getAttribute("partner"));
    parameterMap.put("payerIP", request.getLocalAddr());
    parameterMap.put("orderId", sn);
    parameterMap.put("orderAmount", payment.getAmount().multiply(new BigDecimal(100)).setScale(0).toString());
    parameterMap.put("orderTime", new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()));
    parameterMap.put("orderTimestamp", new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()));
    parameterMap.put("productName",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 100));
    parameterMap.put("productDesc",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 400));
    parameterMap.put("ext1", "guilin");
    parameterMap.put("payType", "00");
    parameterMap.put("signMsg", generateSign(parameterMap));
    return parameterMap;
}

From source file:de.fu_berlin.inf.dpp.concurrent.jupiter.internal.text.DeleteOperation.java

/**
 * {@inheritDoc}//from  ww  w  . j  a va2  s.  c o m
 */
@Override
public String toString() {
    return "Delete(" + this.position + ",'"
            + StringEscapeUtils.escapeJava(StringUtils.abbreviate(this.text, 150)) + "')";
}

From source file:mobi.chouette.model.Line.java

/**
 * set comment <br/>//from   w  w  w. j a  v a  2 s .com
 * truncated to 255 characters if too long
 * 
 * @param value
 *            New value
 */
public void setComment(String value) {
    comment = StringUtils.abbreviate(value, 255);
}

From source file:net.osxx.plugin.pay99bill.Pay99billPlugin.java

@Override
public Map<String, Object> getParameterMap(String sn, String description, HttpServletRequest request) {
    PluginConfig pluginConfig = getPluginConfig();
    Payment payment = getPayment(sn);/*  w w  w  .  j  a  v  a 2  s  .  c o m*/
    Map<String, Object> parameterMap = new LinkedHashMap<String, Object>();
    parameterMap.put("inputCharset", "1");
    parameterMap.put("pageUrl", getNotifyUrl(sn, NotifyMethod.sync));
    parameterMap.put("bgUrl", getNotifyUrl(sn, NotifyMethod.async));
    parameterMap.put("version", "v2.0");
    parameterMap.put("language", "1");
    parameterMap.put("signType", "1");
    parameterMap.put("merchantAcctId", pluginConfig.getAttribute("partner"));
    parameterMap.put("payerIP", request.getLocalAddr());
    parameterMap.put("orderId", sn);
    parameterMap.put("orderAmount", payment.getAmount().multiply(new BigDecimal(100)).setScale(0).toString());
    parameterMap.put("orderTime", new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()));
    parameterMap.put("orderTimestamp", new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()));
    parameterMap.put("productName",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 100));
    parameterMap.put("productDesc",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 400));
    parameterMap.put("ext1", "osxx");
    parameterMap.put("payType", "00");
    parameterMap.put("signMsg", generateSign(parameterMap));
    return parameterMap;
}

From source file:eu.databata.engine.util.PropagatorLock.java

private String generateToken() {
    return StringUtils.abbreviate("" + Math.random(), 200);
}

From source file:net.groupbuy.plugin.pay99bill.Pay99billPlugin.java

@Override
public Map<String, Object> getParameterMap(String sn, String description, HttpServletRequest request) {
    PluginConfig pluginConfig = getPluginConfig();
    Payment payment = getPayment(sn);/*from   w w  w  .jav  a2 s  . co  m*/
    Map<String, Object> parameterMap = new LinkedHashMap<String, Object>();
    parameterMap.put("inputCharset", "1");
    parameterMap.put("pageUrl", getNotifyUrl(sn, NotifyMethod.sync));
    parameterMap.put("bgUrl", getNotifyUrl(sn, NotifyMethod.async));
    parameterMap.put("version", "v2.0");
    parameterMap.put("language", "1");
    parameterMap.put("signType", "1");
    parameterMap.put("merchantAcctId", pluginConfig.getAttribute("partner"));
    parameterMap.put("payerIP", request.getLocalAddr());
    parameterMap.put("orderId", sn);
    parameterMap.put("orderAmount", payment.getAmount().multiply(new BigDecimal(100)).setScale(0).toString());
    parameterMap.put("orderTime", new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()));
    parameterMap.put("orderTimestamp", new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()));
    parameterMap.put("productName",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 100));
    parameterMap.put("productDesc",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 400));
    parameterMap.put("ext1", "shopxx");
    parameterMap.put("payType", "00");
    parameterMap.put("signMsg", generateSign(parameterMap));
    return parameterMap;
}

From source file:com.sammyun.plugin.pay99bill.Pay99billPlugin.java

@Override
public Map<String, Object> getParameterMap(String sn, String description, HttpServletRequest request) {
    PluginConfig pluginConfig = getPluginConfig();
    Payment payment = getPayment(sn);//from  w ww .  j  a  va  2s.  c  o  m
    Map<String, Object> parameterMap = new LinkedHashMap<String, Object>();
    parameterMap.put("inputCharset", "1");
    parameterMap.put("pageUrl", getNotifyUrl(sn, NotifyMethod.sync));
    parameterMap.put("bgUrl", getNotifyUrl(sn, NotifyMethod.async));
    parameterMap.put("version", "v2.0");
    parameterMap.put("language", "1");
    parameterMap.put("signType", "1");
    parameterMap.put("merchantAcctId", pluginConfig.getAttribute("partner"));
    parameterMap.put("payerIP", request.getLocalAddr());
    parameterMap.put("orderId", sn);
    parameterMap.put("orderAmount", payment.getAmount().multiply(new BigDecimal(100)).setScale(0).toString());
    parameterMap.put("orderTime", new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()));
    parameterMap.put("orderTimestamp", new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()));
    parameterMap.put("productName",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 100));
    parameterMap.put("productDesc",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 400));
    parameterMap.put("ext1", "preschoolEdu");
    parameterMap.put("payType", "00");
    parameterMap.put("signMsg", generateSign(parameterMap));
    return parameterMap;
}

From source file:com.dp2345.plugin.pay99bill.Pay99billPlugin.java

@Override
public Map<String, Object> getParameterMap(String sn, String description, HttpServletRequest request) {
    PluginConfig pluginConfig = getPluginConfig();
    Payment payment = getPayment(sn);/*ww  w.j  a  v  a2 s  . c o  m*/
    Map<String, Object> parameterMap = new LinkedHashMap<String, Object>();
    parameterMap.put("inputCharset", "1");
    parameterMap.put("pageUrl", getNotifyUrl(sn, NotifyMethod.sync));
    parameterMap.put("bgUrl", getNotifyUrl(sn, NotifyMethod.async));
    parameterMap.put("version", "v2.0");
    parameterMap.put("language", "1");
    parameterMap.put("signType", "1");
    parameterMap.put("merchantAcctId", pluginConfig.getAttribute("partner"));
    parameterMap.put("payerIP", request.getLocalAddr());
    parameterMap.put("orderId", sn);
    parameterMap.put("orderAmount", payment.getAmount().multiply(new BigDecimal(100)).setScale(0).toString());
    parameterMap.put("orderTime", new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()));
    parameterMap.put("orderTimestamp", new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()));
    parameterMap.put("productName",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 100));
    parameterMap.put("productDesc",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 400));
    parameterMap.put("ext1", "dp2345");
    parameterMap.put("payType", "00");
    parameterMap.put("signMsg", generateSign(parameterMap));
    return parameterMap;
}

From source file:net.shopxx.plugin.pay99billPayment.Pay99billPaymentPlugin.java

@Override
public Map<String, Object> getParameterMap(String sn, String description, HttpServletRequest request) {
    PluginConfig pluginConfig = getPluginConfig();
    PaymentLog paymentLog = getPaymentLog(sn);
    Map<String, Object> parameterMap = new LinkedHashMap<String, Object>();
    parameterMap.put("inputCharset", "1");
    parameterMap.put("pageUrl", getNotifyUrl(PaymentPlugin.NotifyMethod.sync));
    parameterMap.put("bgUrl", getNotifyUrl(PaymentPlugin.NotifyMethod.async));
    parameterMap.put("version", "v2.0");
    parameterMap.put("language", "1");
    parameterMap.put("signType", "1");
    parameterMap.put("merchantAcctId", pluginConfig.getAttribute("partner"));
    parameterMap.put("payerIP", request.getLocalAddr());
    parameterMap.put("orderId", sn);
    parameterMap.put("orderAmount",
            paymentLog.getAmount().multiply(new BigDecimal(100)).setScale(0).toString());
    parameterMap.put("orderTime", DateFormatUtils.format(new Date(), "yyyyMMddhhmmss"));
    parameterMap.put("orderTimestamp", DateFormatUtils.format(new Date(), "yyyyMMddhhmmss"));
    parameterMap.put("productName",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 100));
    parameterMap.put("productDesc",
            StringUtils.abbreviate(description.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5 ]", ""), 400));
    parameterMap.put("ext1", "shopxx");
    parameterMap.put("payType", "00");
    parameterMap.put("signMsg", generateSign(parameterMap));
    return parameterMap;
}

From source file:com.fortify.bugtracker.tgt.tfs.processor.TFSTargetProcessorSubmitIssues.java

@Override
protected TargetIssueLocator submitIssue(Context context, LinkedHashMap<String, Object> issueData) {
    TFSRestConnection conn = TFSConnectionFactory.getConnection(context);
    issueData.put("System.Title", StringUtils.abbreviate((String) issueData.get("System.Title"), 254));
    return conn.submitIssue(ICLIOptionsTFS.CLI_TFS_COLLECTION.getValue(context),
            ICLIOptionsTFS.CLI_TFS_PROJECT.getValue(context), getWorkItemType(), issueData);
}