code: public static Method getReadMethod(Class<?> clazz, String propertyName) {
          Method readMethod = null;
          try {
              PropertyDescriptor[] thisProps = Introspector.getBeanInfo(clazz).getPropertyDescriptors();
              for (PropertyDescriptor pd : thisProps) {
                  if (pd.getName().equals(propertyName) && pd.getReadMethod() != null) {
                      readMethod = pd.getReadMethod();
                      break;
                  }
              }
          } catch (IntrospectionException ex) {
              Logger.getLogger(BeanUtils.class.getName()).log(Level.SEVERE, null, ex);
          }
          return readMethod;
      }
docs: Helper method for getting a read method for a property.
  
  @param clazz the type to get the method for.
  @param propertyName the name of the property.
  @return the method for reading the property.