code: public static Class<?> getPropertyType(Class<?> clazz, String propertyName) {
          if (clazz == null || !StringUtils.hasText(propertyName)) {
              return null;
          }
  
          try {
              PropertyDescriptor desc=BeanUtils.getPropertyDescriptor(clazz, propertyName);
              if (desc != null) {
                  return desc.getPropertyType();
              }
              return null;
          }
          catch (Exception e) {
              // if there are any errors in instantiating just return null for the moment
              return null;
          }
      }
docs: Returns the type of the given property contained within the specified class
  
  @param clazz The class which contains the property
  @param propertyName The name of the property
  
  @return The property type or null if none exists