Here you can find the source of getGetterMethod(Class> c, String field)
public static Method getGetterMethod(Class<?> c, String field)
//package com.java2s; //License from project: Open Source License import java.lang.reflect.Method; import static java.util.Locale.ENGLISH; public class Main { public static Method getGetterMethod(Class<?> c, String field) { try {/*from w w w . j a va 2s . com*/ return c.getMethod(getterMethod(field)); } catch (NoSuchMethodException e) { throw new RuntimeException(e); } } public static String getterMethod(String field) { return "get" + capitalize(field); } public static String capitalize(String s) { if (s == null || s.length() == 0) { return s; } return s.substring(0, 1).toUpperCase(ENGLISH) + s.substring(1); } }