Java Utililty Methods Field Name Get

List of utility methods to do Field Name Get

Description

The list of methods to do Field Name Get are organized into topic(s).

Method

StringfieldNameToConstant(String fieldname)
field Name To Constant
return camelCaseNameToConstant(fieldname);
StringfieldNameToMethodName(String methodPrefix, String fieldName)
field name to method name
return fieldNameToMethodName(methodPrefix, fieldName, false);
StringfieldNameToPath(String fieldName)
Converts a fieldName into a readable path
final StringBuilder path = new StringBuilder();
boolean lastUpper = true;
for (char c : fieldName.toCharArray()) {
    if (c == '_') {
        lastUpper = true;
        path.append('.');
        continue;
    if (Character.isUpperCase(c)) {
        c = Character.toLowerCase(c);
        if (!lastUpper) {
            lastUpper = true;
            path.append('-');
    } else {
        lastUpper = false;
    path.append(c);
return path.toString();