private static PropertyDescriptor getPropertyDescriptor ( final Class < ? > type , final String propertyName ) { Exceptions . requireNonNull ( type ) ; Exceptions . requireNonNull ( propertyName ) ; if ( ! propertyName . contains ( "." ) ) { return doGetPropertyDescriptor ( type , propertyName ) ; } else { String [ ] propertyNames = propertyName . split ( "[.]" ) ; Class < ? > clazz = type ; PropertyDescriptor propertyDescriptor = null ; for ( String pName : propertyNames ) { propertyDescriptor = doGetPropertyDescriptor ( clazz , pName ) ; if ( propertyDescriptor == null ) { return null ; } clazz = propertyDescriptor . getPropertyType ( ) ; } return propertyDescriptor ; } }
This needs refactor and put into Refleciton .