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

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

Introduction

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

Prototype

public static String lowerCase(String str) 

Source Link

Document

Converts a String to lower case as per String#toLowerCase() .

Usage

From source file:org.jspringbot.keyword.expression.engine.CaseInsensitiveResolver.java

@Override
public Object getValue(ELContext context, Object base, Object property) throws ELException {
    try {/*from   ww w .j a v  a 2 s  .  c o  m*/
        if (String.class.isInstance(property)) {
            property = StringUtils.lowerCase(property.toString());
        }

        return super.getValue(context, base, property);
    } catch (PropertyNotFoundException e) {
        return null;
    }
}

From source file:org.jspringbot.keyword.expression.engine.CaseInsensitiveTypeConverter.java

@Override
protected String coerceToString(Object value) {
    return StringUtils.lowerCase(super.coerceToString(value));
}

From source file:org.jspringbot.keyword.selenium.SeleniumHelper.java

private String getDomain(String urlString) {
    try {/*from w ww  .j a v a2 s  .c o m*/
        URL url = new URL(urlString);

        return StringUtils.lowerCase(url.getHost());
    } catch (MalformedURLException e) {
        e.printStackTrace();
        return null;
    }
}

From source file:org.jspringbot.keyword.selenium.SeleniumHelper.java

public boolean isMacOS() {
    String os = StringUtils.lowerCase(System.getProperty("os.name", "generic"));

    return os.contains("mac") || os.contains("darwin");
}

From source file:org.jspringbot.keyword.string.ToLowerCase.java

public Object execute(Object[] params) {
    return StringUtils.lowerCase(String.valueOf(params[0]));
}

From source file:org.jspringbot.syntax.HighlighterUtils.java

private static void cssColor(StringBuilder buf, String style, Color color) {
    String rgb = Integer.toHexString(color.getRGB());
    rgb = rgb.substring(2, rgb.length());

    buf.append(style).append(":#").append(StringUtils.lowerCase(rgb)).append(";");
}

From source file:org.jumpmind.metl.core.runtime.component.ModelAttributeScriptHelper.java

public String lower() {
    String text = value != null ? value.toString() : "";
    return StringUtils.lowerCase(text);
}

From source file:org.kuali.kfs.module.endow.document.EndowmentAccountingLineParserBase.java

/**
 * Parses the csv line/*from  ww  w .jav  a 2s .  com*/
 * 
 * @param accountingLineClass
 * @param lineToParse
 * @return Map containing accounting line attribute,value pairs
 */
protected Map<String, String> parseAccountingLine(Class<? extends EndowmentAccountingLine> accountingLineClass,
        String lineToParse) {
    if (StringUtils.isNotBlank(fileName) && !StringUtils.lowerCase(fileName).endsWith(".csv")) {
        throw new AccountingLineParserException("unsupported file format: " + fileName,
                ERROR_INVALID_FILE_FORMAT, fileName);
    }
    String[] attributes = chooseFormat(accountingLineClass);
    String[] attributeValues = StringUtils.splitPreserveAllTokens(lineToParse, ",");

    Map<String, String> attributeValueMap = new HashMap<String, String>();

    for (int i = 0; i < Math.min(attributeValues.length, attributes.length); i++) {
        attributeValueMap.put(attributes[i], attributeValues[i]);
    }

    return attributeValueMap;
}

From source file:org.kuali.kfs.module.endow.util.LineParserBase.java

/**
 * Checks whether the specified line import file is not null and of a valid format; throws exceptions if conditions not
 * satisfied.//from  w  w w. java2 s.co  m
 * 
 * @param lineClass the specified line import file
 */
protected void checkLineFile(FormFile lineFile) {
    if (lineFile == null)
        throw new LineParserException("Invalid (null) Line import file", KFSKeyConstants.ERROR_UPLOADFILE_NULL);

    if (lineFile.getFileSize() == 0)
        throw new LineParserException("Invalid (null) Line import file", KFSKeyConstants.ERROR_UPLOADFILE_NULL);

    String fileName = lineFile.getFileName();
    if (StringUtils.isNotBlank(fileName) && !StringUtils.lowerCase(fileName).endsWith(".csv"))
        throw new LineParserException("unsupported Line import file format: " + fileName,
                KFSKeyConstants.ERROR_LINEPARSER_INVALID_FILE_FORMAT, fileName);
}

From source file:org.kuali.kfs.module.purap.util.ItemParserBase.java

/**
 * Checks whether the specified item import file is not null and of a valid format;
 * throws exceptions if conditions not satisfied.
 * /*from w w  w .j  av  a2s  .c  o  m*/
 * @param itemClass the specified item import file
 */
protected void checkItemFile(FormFile itemFile) {
    if (itemFile == null) {
        throw new ItemParserException("invalid (null) item import file", KFSKeyConstants.ERROR_UPLOADFILE_NULL);
    }
    String fileName = itemFile.getFileName();
    if (StringUtils.isNotBlank(fileName) && !StringUtils.lowerCase(fileName).endsWith(".csv")
            && !StringUtils.lowerCase(fileName).endsWith(".xls")) {
        throw new ItemParserException("unsupported item import file format: " + fileName,
                ERROR_ITEMPARSER_INVALID_FILE_FORMAT, fileName);
    }
}