spring-framework / org.springframework.beans / BeanUtils / findPropertyForMethod

findPropertyForMethod

@Nullable open static fun findPropertyForMethod(method: Method): PropertyDescriptor

Find a JavaBeans PropertyDescriptor for the given method, with the method either being the read method or the write method for that bean property.

Parameters

method - the method to find a corresponding PropertyDescriptor for, introspecting its declaring class

Exceptions

BeansException - if PropertyDescriptor lookup fails

Return
the corresponding PropertyDescriptor, or null if none

@Nullable open static fun findPropertyForMethod(method: Method, clazz: Class<*>): PropertyDescriptor

Find a JavaBeans PropertyDescriptor for the given method, with the method either being the read method or the write method for that bean property.

Parameters

method - the method to find a corresponding PropertyDescriptor for

clazz - the (most specific) class to introspect for descriptors

Exceptions

BeansException - if PropertyDescriptor lookup fails

Return
the corresponding PropertyDescriptor, or null if none

Since
3.2.13