Example usage for org.apache.commons.lang3.text WordUtils uncapitalize

List of usage examples for org.apache.commons.lang3.text WordUtils uncapitalize

Introduction

In this page you can find the example usage for org.apache.commons.lang3.text WordUtils uncapitalize.

Prototype

public static String uncapitalize(final String str) 

Source Link

Document

Uncapitalizes all the whitespace separated words in a String.

Usage

From source file:com.yahoo.elide.graphql.NonEntityDictionary.java

/**
 * Add given class to dictionary./*from  ww w  .j  a v a  2 s  .c o  m*/
 *
 * @param cls Entity bean class
 */
@Override
public void bindEntity(Class<?> cls) {
    String type = WordUtils.uncapitalize(cls.getSimpleName());

    Class<?> duplicate = bindJsonApiToEntity.put(type, cls);

    if (duplicate != null && !duplicate.equals(cls)) {
        log.error("Duplicate binding {} for {}, {}", type, cls, duplicate);
        throw new DuplicateMappingException(type + " " + cls.getName() + ":" + duplicate.getName());
    }

    entityBindings.put(cls, new EntityBinding(this, cls, type, type));
}

From source file:bear.plugins.Plugin.java

public static String shortenName(String className) {
    int lastDotIndex = className.lastIndexOf('.');

    int end = className.lastIndexOf("Plugin");

    if (end == -1)
        end = className.length();//from www . j ava  2s  . co  m

    return WordUtils.uncapitalize(className.substring(lastDotIndex + 1, end));
}

From source file:com.incapture.rapgen.UpCaseRenderer.java

@Override
public String toString(Object inputObject, String format) {
    String input = inputObject.toString();
    switch (format) {
    case "upcase":
        return input.substring(0, 1).toUpperCase() + input.substring(1);
    case "uncapitalize":
        return WordUtils.uncapitalize(input);
    case "lower":
        return input.toLowerCase();
    case "upper":
        return input.toUpperCase();
    }/*from   w  w w. ja  v  a 2  s  . c  o m*/
    return input;
}

From source file:appStructure.MainApp.java

/**
 * //  w  w  w  .jav a2s  . c om
 * @param questionnaires
 */
private static void creerQuestionaires(Map<String, Module> questionnaires) {

    File folder = new File("./Ressources");
    File[] listOfFiles = folder.listFiles();
    for (int i = 0; i < listOfFiles.length; i++) {
        if (listOfFiles[i].isFile()) {
            String fileName = listOfFiles[i].getName().substring(0, listOfFiles[i].getName().lastIndexOf("."));

            questionnaires.put(WordUtils.uncapitalize(fileName), new Module(fileName));

        }
    }

}

From source file:com.kildeen.visor.core.api.permission.DefaultPermissionConverter.java

@Override
public String getPartId(final Class<? extends PartPermission> permissionClass) {
    String permission = WordUtils.uncapitalize(permissionClass.getEnclosingClass().getSimpleName())
            + permissionClass.getSimpleName();
    return permission;
}

From source file:com.opensource.dbhelp.dbutils.CamelBeanProcessor.java

/**
 * ?user_idUSER_ID?userId/*  w w w .j  a v  a2 s. c o m*/
 *
 * @param name
 *            ??
 * @return ???
 */
private String formatColName(String name) {
    if (name == null || "".equals(name)) {
        return "";
    }
    String rstr = name.toLowerCase();
    rstr = WordUtils.uncapitalize(WordUtils.capitalize(rstr, "_".toCharArray()));
    rstr = rstr.replaceAll("_", "");
    return rstr;
}

From source file:eu.itesla_project.modelica_export.records.BranchRecord.java

@Override
public void createModelicaName(ModExportContext modContext, DDBManager ddbManager, SimulatorInst modelicaSim) {
    Equipments.ConnectionInfo terminal1Info = Equipments
            .getConnectionInfoInBusBreakerView(twoTerminalsConnectable.getTerminal1());
    Equipments.ConnectionInfo terminal2Info = Equipments
            .getConnectionInfoInBusBreakerView(twoTerminalsConnectable.getTerminal2());

    bus1 = terminal1Info.getConnectionBus();
    bus2 = terminal2Info.getConnectionBus();

    //System.out.println("Trafo: " + this.twoTerminalsConnectable.getId() + ". Terminal 1: " + bus1.getId() + ". Terminal 2: " + bus2.getId());

    nodeName1 = parseName(bus1.getId());
    nodeName2 = parseName(bus2.getId());

    String branchName = parseName(twoTerminalsConnectable.getId()); //CIM ID
    String modelicaName = DEFAULT_BRANCH_PREFIX + branchName; //CIM ID
    modelicaName = WordUtils.uncapitalize(modelicaName.substring(0, 1)) + modelicaName.substring(1);

    //        modelicaName = parseName(modelicaName); //Aadido de cara al conversor de PSSE
    modContext.dictionary.add(twoTerminalsConnectable, modelicaName);
    super.setModelicaName(modelicaName);

    ModelTemplate model = null;//from  w ww  .jav  a  2 s  . c  om
    String ddbid = StaticData.MTC_PREFIX_NAME
            + super.mtcMapper.get(DEFAULT_BRANCH_PREFIX.substring(0, 1).toUpperCase() + DEFAULT_BRANCH_PREFIX);

    ModelTemplateContainer mtc = ddbManager.findModelTemplateContainer(ddbid);

    if (mtc == null) {
        //         _log.warn("EUROSTAG Model Template Container does not exist. Searching Default MODELICA Model Template Container in DDB.");
        mtc = ddbManager.findModelTemplateContainer(StaticData.MTC_PREFIX_NAME + DEFAULT_BRANCH_TYPE);
    }

    if (mtc != null) {
        for (ModelTemplate mt : mtc.getModelTemplates()) {
            if (mt.getTypeName().equalsIgnoreCase(DEFAULT_BRANCH_TYPE))
                model = mt;
        }

        if (model != null) {
            super.setModelicaType(model.getTypeName());
        } else {
            super.setCorrect(false);
            _log.error("MODELICA Model Template does not exist in DDB.");
        }
    } else {
        super.setCorrect(false);
        //         _log.error("MODELICA Model Template Container does not exist in DDB.");
    }
}

From source file:eu.itesla_project.modelica_export.records.CapacitorRecord.java

@Override
public void createModelicaName(ModExportContext modContext, DDBManager ddbManager, SimulatorInst modelicaSim) {
    String modelicaName = DEFAULT_CAPACITOR_PREFIX + "_" + parseName(this.capacitor.getId());
    modelicaName = WordUtils.uncapitalize(modelicaName.substring(0, 1)) + modelicaName.substring(1);
    modelicaName = StaticData.PREF_CAP + modelicaName;
    modContext.dictionary.add(capacitor, modelicaName);
    super.setModelicaName(modelicaName);
}

From source file:com.sonicle.webtop.core.sdk.bol.js.JsOptions.java

public Map<String, Object> getWithPrefix(String prefix) {
    JsOptions map = new JsOptions();
    for (Map.Entry<String, Object> entry : entrySet()) {
        if (StringUtils.startsWith(entry.getKey(), prefix)) {
            map.put(WordUtils.uncapitalize(StringUtils.removeStart(entry.getKey(), prefix)), entry.getValue());
        }//from   ww w  . jav  a2s .  c  om
    }
    return map;
}

From source file:bear.main.ProjectGenerator.java

private void addPlugin(Class<? extends Plugin> plugin, StringBuilder fieldsSB, StringBuilder importsSB) {
    String simpleName = plugin.getSimpleName();

    String varName = WordUtils.uncapitalize(StringUtils.substringBeforeLast(simpleName, "Plugin"));

    fieldsSB.append("    ").append(simpleName).append(" ").append(varName).append("\n");

    importsSB.append("import ").append(plugin.getName()).append("\n");
}