Java Code Examples for org.apache.commons.text.CaseUtils#toCamelCase()

The following examples show how to use org.apache.commons.text.CaseUtils#toCamelCase() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DialogUtils.java    From aem-component-generator with Apache License 2.0 6 votes vote down vote up
/**
 * Creates the tab structure.
 *
 * @param document The {@link Document} object
 * @param tab the tab
 * @param node The {@link Node} object
 * @return the node {@link Node} object
 */
private static Node createTabStructure(Document document, Tab tab, Node node) {
    Element tabElement = createNode(document, tab.getId(), Constants.RESOURCE_TYPE_CONTAINER);
    String label = tab.getLabel();
    if (StringUtils.isBlank(label)) {
        label = CaseUtils.toCamelCase(tab.getId(), true);
    }
    tabElement.setAttribute(Constants.PROPERTY_JCR_TITLE, label);
    Element columnElement = createNode(document, "column", Constants.RESOURCE_TYPE_CONTAINER);
    
    Element layoutElement = document.createElement("layout");
    layoutElement.setAttribute(Constants.JCR_PRIMARY_TYPE, Constants.NT_UNSTRUCTURED);
    layoutElement.setAttribute(Constants.PROPERTY_SLING_RESOURCETYPE, Constants.RESOURCE_TYPE_CORAL_FIXEDCOLUMNS);

    tabElement.appendChild(layoutElement);
    
    return node.appendChild(tabElement).appendChild(createUnStructuredNode(document, "items"))
            .appendChild(columnElement).appendChild(createUnStructuredNode(document, "items"));
}
 
Example 2
Source File: Property.java    From aem-component-generator with Apache License 2.0 5 votes vote down vote up
public String getField() {
    if (StringUtils.isNotBlank(field)) {
        return field;
    } else if (StringUtils.isNoneBlank(label)) {
        return CaseUtils.toCamelCase(label.replaceAll("[^A-Za-z0-9+]", " "), false);
    }
    return field;
}
 
Example 3
Source File: Property.java    From aem-component-generator with Apache License 2.0 5 votes vote down vote up
public String getFieldGetterName() {
    if (StringUtils.isNotBlank(field)) {
        return StringUtils.capitalize(field);
    } else if (StringUtils.isNoneBlank(label)) {
        return CaseUtils.toCamelCase(label.replaceAll("[^A-Za-z0-9+]", " "), true);
    }
    return field;
}
 
Example 4
Source File: GenerationConfig.java    From aem-component-generator with Apache License 2.0 4 votes vote down vote up
public String getJavaFormatedName() {
    if(StringUtils.isNotBlank(name)){
        javaFormatedName = CaseUtils.toCamelCase(name.replaceAll("-", " "), true);
    }
    return javaFormatedName;
}
 
Example 5
Source File: Utils.java    From api with Apache License 2.0 4 votes vote down vote up
public static String stringCamelCase(String input) {
    return CaseUtils.toCamelCase(input, false, '-', '_', ' ');
}
 
Example 6
Source File: ReferenceTestGenerator.java    From teku with Apache License 2.0 4 votes vote down vote up
private static String toCamelCase(final String input) {
  if (input.isEmpty()) {
    return input;
  }
  return CaseUtils.toCamelCase(sanitise(input), true, '_');
}