Java Reflection Method Getter Get getGetterName(Method m)

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

Description

get Getter Name

License

Open Source License

Declaration

private static String getGetterName(Method m) 

Method Source Code


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

import java.lang.reflect.*;

public class Main {
    private static String getGetterName(Method m) {
        String name = m.getName();

        if (name.substring(0, 3).equals("get"))
            name = name.substring(3);/*from ww w. j a v  a  2 s  . co m*/
        else if (name.substring(0, 2).equals("is"))
            name = name.substring(2);

        return name;
    }
}

Related

  1. getGetterMethods(Class pojoClass)
  2. getGetterMethods(final Class clazz)
  3. getGetterName(Field field)
  4. getGetterName(Field field)
  5. getGetterName(final Field field)
  6. getGetterName(Method m)
  7. getGetterName(Method method)
  8. getGetterName(Method mtd)
  9. getGetterOrNull(Class clazz, String name, Class type)