Here you can find the source of getGetter(Class
public static <E> Method getGetter(Class<E> realClass, String pAttributeName) throws Exception
//package com.java2s; //License from project: Apache License import java.lang.reflect.Method; public class Main { public static <E> Method getGetter(Class<E> realClass, String pAttributeName) throws Exception { if (realClass == null || pAttributeName == null || pAttributeName.trim().equals("")) { throw new Exception("Error ::: realClass is null or pAttributeName is null or empty string "); }//from w w w .j ava 2 s .co m Method getter = realClass.getDeclaredMethod( "get" + pAttributeName.substring(0, 1).toUpperCase() + pAttributeName.substring(1)); return getter; } }