public static Field getGetterField ( Method method ) { if ( method == null ) { throw new IllegalArgumentException ( "method cannot be null." ) ; } Class < ? > clazz = method . getDeclaringClass ( ) ; String fName = stripGetterPrefix ( method . getName ( ) ) ; Field field = null ; try { field = findField ( clazz , fName ) ; } catch ( Exception ignore ) { } return field ; }
Find the field for the getter method based on the get methods name . It finds the field on the declaring class .