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

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

Introduction

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

Prototype

public static String upperCase(String str) 

Source Link

Document

Converts a String to upper case as per String#toUpperCase() .

Usage

From source file:edu.mayo.cts2.framework.plugin.service.bprdf.profile.entitydescription.EntityDirectoryEntryCallback.java

@Override
public void afterBinding(EntityDirectoryEntry bindingResult, CallbackContext context) {

    String acronym = (String) context.getQueryParams().get("acronym");

    if (acronym == null) {
        acronym = (String) context.getQueryParams().get("restrictToGraph");
    }/* w  ww . j a v a  2 s.co m*/

    if (acronym == null) {
        acronym = (String) context.getCallbackIds().get("acronym");
    }

    Assert.notNull(acronym);

    acronym = StringUtils.upperCase(acronym);

    String ontologyId = this.idService.getOntologyIdForAcronym(acronym);
    String id = this.idService.getCurrentIdForOntologyId(ontologyId);

    //TODO: this method needs to be in the UrlConstructor
    bindingResult.setHref(this.urlConstructor.getServerRootWithAppName() + "/" + URIHelperInterface.ENTITY + "/"
            + EncodingUtils.encodeScopedEntityName(bindingResult.getName()));

    for (DescriptionInCodeSystem description : bindingResult.getKnownEntityDescription()) {
        CodeSystemVersionReference ref = this.codeSystemVersionReferenceFactory
                .getCodeSystemVersionReferenceFor(id);
        description.setHref(this.urlConstructor.createEntityUrl(ref.getCodeSystem().getContent(),
                ref.getVersion().getContent(), bindingResult.getName()));

        description.setDescribingCodeSystemVersion(ref);
    }
}

From source file:com.siberhus.web.ckeditor.utils.PathUtils.java

/**
 * Remove or add slashes as indicated in rules
 * /*from  ww w  .ja v a  2s.c o m*/
 * rules: space separated list of rules R- = remove slash on right R+ = add
 * slash on right L- = remove slash on left L+ = add slash on left
 */
public static String checkSlashes(String path, String rules, boolean isUrl) {
    String result = StringUtils.trim(path);
    if (StringUtils.isNotBlank(result)) {
        String rls[] = rules.split(" ");
        String separator = isUrl ? "/" : File.separator;
        for (String r : rls) {
            boolean isAdd = ("+".equals(String.valueOf(r.charAt(1))));
            if (isAdd) {
                if ("L".equals(StringUtils.upperCase(r.charAt(0) + ""))) {
                    // Add separator on left
                    if (!result.startsWith("/") && !result.startsWith("\\")) {
                        result = separator + result;
                    }
                } else {
                    // Add separator on right
                    if (!result.endsWith("/") && !result.endsWith("\\")) {
                        result = result + separator;
                    }
                }
            } else {
                if ("L".equals(StringUtils.upperCase(r.charAt(0) + ""))) {
                    // Remove separator on left
                    if (result.startsWith("/") || result.startsWith("\\")) {
                        result = result.substring(1);
                    }
                } else {
                    // Remove separator on right
                    if (result.endsWith("/") || result.endsWith("\\")) {
                        result = result.substring(0, result.length() - 1);
                    }
                }
            }
        }
    }
    return result;
}

From source file:com.adobe.acs.commons.quickly.results.Result.java

public String getResultType() {
    return StringUtils.upperCase(resultType);
}

From source file:it.csi.iride2.iridefed.entity.Role.java

/**
 * Set the <code>IRIDE</code> Role code.
 *
 * @param code the <code>IRIDE</code> Role code
 *//* ww  w. ja v a2 s .  c  o m*/
public void setCode(String code) {
    this.code = StringUtils.upperCase(code);
}

From source file:com.adobe.acs.commons.quickly.results.Result.java

public void setResultType(final String resultType) {
    this.resultType = StringUtils.upperCase(resultType);
}

From source file:com.evolveum.midpoint.model.common.expression.functions.BasicExpressionFunctions.java

/**
 * Convert string to upper case.
 */
public static String uc(String orig) {
    return StringUtils.upperCase(orig);
}

From source file:it.csi.iride2.iridefed.entity.Role.java

/**
 * Set the <code>IRIDE</code> Role domain code.
 *
 * @param domain the <code>IRIDE</code> Role domain code
 *//*from   ww  w. j av  a  2 s. c  om*/
public void setDomain(String domain) {
    this.domain = StringUtils.upperCase(domain);
}

From source file:com.haulmont.cuba.web.gui.components.WebSearchField.java

protected void executeSearch(final String newFilter) {
    if (optionsDatasource == null)
        return;/*from w ww.  ja  v  a  2  s. c  o m*/

    String filterForDs = newFilter;
    if (mode == Mode.LOWER_CASE) {
        filterForDs = StringUtils.lowerCase(newFilter);
    } else if (mode == Mode.UPPER_CASE) {
        filterForDs = StringUtils.upperCase(newFilter);
    }

    if (escapeValueForLike && StringUtils.isNotEmpty(filterForDs)) {
        filterForDs = QueryUtils.escapeForLike(filterForDs);
    }

    if (!isRequired() && StringUtils.isEmpty(filterForDs)) {
        setValue(null);
        if (optionsDatasource.getState() == State.VALID) {
            optionsDatasource.clear();
        }
        return;
    }

    if (StringUtils.length(filterForDs) >= minSearchStringLength) {
        optionsDatasource.refresh(Collections.singletonMap(SEARCH_STRING_PARAM, filterForDs));

        if (optionsDatasource.getState() == State.VALID) {
            if (optionsDatasource.size() == 0) {
                if (searchNotifications != null) {
                    searchNotifications.notFoundSuggestions(newFilter);
                }
            } else if (optionsDatasource.size() == 1) {
                setValue(optionsDatasource.getItems().iterator().next());
            }
        }
    } else {
        if (optionsDatasource.getState() == State.VALID) {
            optionsDatasource.clear();
        }

        if (searchNotifications != null && StringUtils.length(newFilter) > 0) {
            searchNotifications.needMinSearchStringLength(newFilter, minSearchStringLength);
        }
    }
}

From source file:at.gv.egovernment.moa.id.configuration.filter.AuthenticationFilter.java

private boolean isExcluded(String url) {
    boolean excluded = false;
    if (MiscUtil.isNotEmpty(excludedPages)) {
        for (String candidate : excludedPages) {
            if (StringUtils.upperCase(url).endsWith(StringUtils.upperCase(candidate))) {
                excluded = true;/*w w w  . j  av  a 2  s  .c  o  m*/
                break;
            }
        }
    }
    if (excludedRegEx != null && !excluded) {
        // log.debug("Trying to match regex \"{}\" with \"{}\".",
        // excludedRegEx.toString(), url);
        if (excludedRegEx.matcher(url).matches()) {
            excluded = true;
        }
    }
    log.debug("URL \"" + url + "\" is " + (excluded ? "" : "NOT ") + "excluded from filter.");
    return excluded;
}

From source file:net.sf.sail.webapp.dao.user.impl.HibernateUserDao.java

/**
 * Capitalizes the first letter of a given String
 * /*from  ww  w  .  jav  a 2s. co m*/
 * @param string
 * @return String
 */
private String capitalizeFirst(String string) {
    return StringUtils.upperCase(StringUtils.left(string, 1)) + StringUtils.right(string, string.length() - 1);
}