@ SuppressWarnings ( "rawtypes" ) public static boolean isPropertyInherited ( Class clz , String propertyName ) { if ( clz == null ) return false ; Assert . isTrue ( StringUtils . hasText ( propertyName ) , "Argument [propertyName] cannot be null or blank" ) ; Class < ? > superClass = clz . getSuperclass ( ) ; PropertyDescriptor pd = BeanUtils . getPropertyDescriptor ( superClass , propertyName ) ; if ( pd != null && pd . getReadMethod ( ) != null ) { return true ; } return false ; }
Checks whether the specified property is inherited from a super class