Here you can find the source of getGetterMethod(Class> clazz, String name)
public static Method getGetterMethod(Class<?> clazz, String name)
//package com.java2s; //License from project: Open Source License import java.lang.reflect.Method; public class Main { public static Method getGetterMethod(Class<?> clazz, String name) { String methodName = convertToMehtodName("get", name); Method method = null;/*w w w. ja va2 s . c om*/ try { method = clazz.getMethod(methodName); } catch (Exception e) { throw new RuntimeException("get method exception - ", e); } return method; } public static String convertToMehtodName(String getterOrSetter, String name) { String methodName = ""; if (name != null && !name.equals("")) { String first = name.substring(0, 1); methodName = getterOrSetter + first.toUpperCase(); if (name.length() > 1) { methodName = methodName + name.substring(1); } } return methodName; } }