Java Reflection Method Getter Get getGetterName(Method mtd)

Here you can find the source of getGetterName(Method mtd)

Description

get Getter Name

License

Open Source License

Declaration

public static String getGetterName(Method mtd) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.lang.reflect.Method;

public class Main {
    public static String getGetterName(Method mtd) {
        String name = mtd.getName();
        if (name.startsWith("get")) {
            return Character.toLowerCase(name.charAt(3)) + name.substring(4);
        }//w w w .  jav  a  2s . com
        if (name.startsWith("is")) {
            return Character.toLowerCase(name.charAt(2)) + name.substring(3);
        }
        return null;
    }
}

Related

  1. getGetterName(Field field)
  2. getGetterName(final Field field)
  3. getGetterName(Method m)
  4. getGetterName(Method m)
  5. getGetterName(Method method)
  6. getGetterOrNull(Class clazz, String name, Class type)
  7. getGetterPropertyName(Method getterMethod)
  8. getGetters(Class c)
  9. getGetters(Class clazz)