static Method getGetter ( Class < ? > targetClass , String propertyName ) { if ( targetClass == null ) { return null ; } final String getterName = getterName ( propertyName , false ) ; Method result = findPublicGetter ( targetClass , getterName , propertyName , false ) ; if ( result == null ) { final String booleanGetterName = getterName ( propertyName , true ) ; result = findPublicGetter ( targetClass , booleanGetterName , propertyName , true ) ; if ( result == null ) { do { result = findNonPublicGetter ( targetClass , getterName , propertyName , false ) ; if ( result == null ) { result = findNonPublicGetter ( targetClass , booleanGetterName , propertyName , true ) ; } } while ( result == null && ( targetClass = targetClass . getSuperclass ( ) ) != null ) ; } } return result ; }
Get getter method for a specified property .