private static Class propertyType(Class enclosingType, String propertyName) {
        Map<String, BeanProperty> properties = BeanIntrospector.getAllProperties(enclosingType);
        int dotIndex = propertyName.indexOf('.');
        if (dotIndex < 0) {
            BeanProperty bp = properties.get(propertyName);
            return bp == null ? null : bp.getType();
        } else {
            String parentName = propertyName.substring(0, dotIndex);
            BeanProperty bp = properties.get(parentName);
            if (bp == null) {
                return null;
            }
            return propertyType(bp.getType(), propertyName.substring(dotIndex + 1));
        }
    }
private static Class propertyType ( Class enclosingType , String propertyName ) { Map < String , BeanProperty > properties = BeanIntrospector . getAllProperties ( enclosingType ) ; int dotIndex = propertyName . indexOf ( '.' ) ; if ( dotIndex < 0 ) { BeanProperty bp = properties . get ( propertyName ) ; return bp == null ? null : bp . getType ( ) ; } else { String parentName = propertyName . substring ( 0 , dotIndex ) ; BeanProperty bp = properties . get ( parentName ) ; if ( bp == null ) { return null ; } return propertyType ( bp . getType ( ) , propertyName . substring ( dotIndex + 1 ) ) ; } }
@return null if unknown