PropertyDescriptor getPropertyDescriptorForPropertyPath ( String propertyPath , Class < ? > propertyType ) { int pos = PropertyAccessorUtils . getFirstNestedPropertySeparatorIndex ( propertyPath ) ; // Handle nested properties recursively. if ( pos > - 1 ) { String nestedProperty = propertyPath . substring ( 0 , pos ) ; String nestedPath = propertyPath . substring ( pos + 1 ) ; PropertyDescriptor propertyDescriptor = BeanUtils . getPropertyDescriptor ( propertyType , nestedProperty ) ; // BeanWrapperImpl nestedBw = getNestedBeanWrapper(nestedProperty); return getPropertyDescriptorForPropertyPath ( nestedPath , propertyDescriptor . getPropertyType ( ) ) ; } else { return BeanUtils . getPropertyDescriptor ( propertyType , propertyPath ) ; } }
Recursively navigate to return a BeanWrapper for the nested property path .