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

StringcapitalizeFieldName(final Field field)
capitalize Field Name
final String fieldName = field.getName();
return fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1);
StringfieldName(String accessorName)
field Name
if (accessorName.startsWith("is"))
    return toLowerCap(accessorName.substring(2));
if (accessorName.startsWith("get"))
    return toLowerCap(accessorName.substring(3));
if (accessorName.startsWith("set"))
    return toLowerCap(accessorName.substring(3));
return accessorName;
StringfieldName(String className, String rawFieldName)
field Name
return className + "#" + rawFieldName;
StringfieldName(String fieldName, String propName)
Construct a complex field name from its component parts.
return fieldName(fieldName, propName, null);
StringfieldName(String getsetName)
field Name
if (!"get".equals(getsetName.substring(0, 3)) && !"set".equals(getsetName.substring(0, 3)))
    throw new IllegalArgumentException("Invalid getter or setter name : " + getsetName);
return String.format("%s%s", getsetName.substring(3, 4).toLowerCase(), getsetName.substring(4));
StringfieldName(String name)
field Name
return name.toLowerCase();
StringfieldName(String nodeName)
field Name
return toJavaIdentifier(nodeName, false);
StringfieldName(String underScore)
field Name
StringBuilder name = new StringBuilder();
underScore = underScore.toLowerCase();
boolean isUnderScore = false;
for (int i = 0; i < underScore.length(); i++) {
    char spell = underScore.charAt(i);
    if (isUnderScore) {
        name.append(Character.toUpperCase(spell));
        isUnderScore = false;
...
StringfieldNameFromPropertyName(final String propertyName)
Field names are derived from property names by lower casing the first character.
String fieldName = null;
if (propertyName != null && propertyName.length() > 0) {
    fieldName = propertyName.substring(0, 1).toLowerCase();
    if (propertyName.length() > 1) {
        fieldName += propertyName.substring(1, propertyName.length());
return fieldName;
...
booleanfieldNameMatchesProperty(final String name, final String property)
field Name Matches Property
return name.equalsIgnoreCase(property);