Example usage for org.apache.commons.lang WordUtils capitalizeFully

List of usage examples for org.apache.commons.lang WordUtils capitalizeFully

Introduction

In this page you can find the example usage for org.apache.commons.lang WordUtils capitalizeFully.

Prototype

public static String capitalizeFully(String str, char[] delimiters) 

Source Link

Document

Converts all the delimiter separated words in a String into capitalized words, that is each word is made up of a titlecase character and then a series of lowercase characters.

Usage

From source file:it.alidays.mapengine.util.Utils.java

public static String arrangeColumnName(String columnName) {
    return WordUtils.capitalizeFully(columnName, new char[] { '_' }).replaceAll("_", "");
}

From source file:com.github.hexosse.pluginframework.utilapi.StringUtil.java

/**
 * Capitalizes every first letter of a word
 *
 * @param string    String to reformat//from  w  w w . j a  va2  s . co  m
 * @param separator Word separator
 * @return Reformatted string
 */
public static String capitalizeFirstLetter(String string, char separator) {
    char[] separators = new char[] { separator };

    return WordUtils.capitalizeFully(string, separators).replace(String.valueOf(separator), SPACE_SEPARATOR);
}

From source file:nc.noumea.mairie.organigramme.core.utility.OrganigrammeUtil.java

public static String capitalizeFullyFrench(String str) {
    return WordUtils.capitalizeFully(str, new char[] { '-', ' ' });
}

From source file:eu.delving.metadata.OptRole.java

private OptRole() {
    String caps = WordUtils.capitalizeFully(toString(), new char[] { '_' }).replaceAll("_", "");
    this.fieldName = Character.toLowerCase(caps.charAt(0)) + caps.substring(1);
}

From source file:cz.muni.fi.lessappcache.filters.FilterClassLoader.java

private String resolveName(String name) {
    char[] delimiter = { '-' };
    return "cz.muni.fi.lessappcache.filters."
            + StringUtils.remove(WordUtils.capitalizeFully(name.substring(1), delimiter), "-") + "Filter";
}

From source file:com.liferay.ide.bndtools.core.templates.AbstractProjectTemplate.java

protected String safeJavaClassName(String projectName) {
    return WordUtils.capitalizeFully(projectName, new char[] { '_', '-', '.', ' ' })
            .replaceAll("[_|\\-|\\.|\\s+]", "");
}

From source file:com.liferay.ide.project.core.modules.NewLiferayComponentDefaultValueService.java

@Override
protected String compute() {
    String retVal = "";

    NewLiferayComponentOp op = _op();//from w  ww.java  2 s . c o m

    String projectName = op.getProjectName().content(true);

    if (projectName == null) {
        return retVal;
    }

    IComponentTemplate<NewLiferayComponentOp> componentTemplate = op.getComponentClassTemplateName()
            .content(true);

    if (componentTemplate != null) {
        String projectTemplate = componentTemplate.getShortName();

        char[] tokens = { '-', '.', '_' };

        String finalProjectName = WordUtils.capitalizeFully(projectName, tokens);

        for (char token : tokens) {
            finalProjectName = finalProjectName.replaceAll("\\" + token, "");
        }

        StringBuffer componentNameBuffer = new StringBuffer(finalProjectName);

        componentNameBuffer.append(projectTemplate);

        return componentNameBuffer.toString();
    }

    return null;
}

From source file:fr.free.pierre.reliquet.trackit.model.Borrower.java

/**
 * @param name the name to set//w  w  w  . ja  v  a 2 s  .c  om
 */
public void setName(String name) {
    this.name = WordUtils.capitalizeFully(name, new char[] { ' ', '-' });
}

From source file:com.liferay.ide.project.core.modules.ComponentNameDefaultValueService.java

@Override
protected String compute() {
    String retVal = "";

    final String projectName = op().getProjectName().content(true);

    if (projectName != null) {
        String projectTemplate = op().getProjectTemplateName().content(true);

        if (projectTemplate != null) {
            final char[] tokens = new char[] { '-', '.', '_' };

            String finalProjectName = WordUtils.capitalizeFully(projectName, tokens);

            for (char token : tokens) {
                finalProjectName = finalProjectName.replaceAll("\\" + token, "");
            }//from  w  ww.  j a  va 2  s . c om

            final StringBuffer componentNameBuffer = new StringBuffer(finalProjectName);

            componentNameBuffer.append(projectTemplate);

            retVal = componentNameBuffer.toString();
        }
    }

    return retVal;
}

From source file:com.willowtreeapps.androidcontentprovidergenerator.model.Entity.java

public String getNameCamelCase() {
    return WordUtils.capitalizeFully(mName, new char[] { '_' }).replaceAll("_", "");
}