public static Object readProperty(Object bean,PropertyDescriptor descriptor){
  try {
    Method readMethod=descriptor.getReadMethod();
    if (readMethod == null) {
      throw new IllegalArgumentException(String.format("%s property does not have a read method.",descriptor.getName()));
    }
    if (!readMethod.isAccessible()) {
      readMethod.setAccessible(true);
    }
    return readMethod.invoke(bean);
  }
 catch (  InvocationTargetException e) {
    throw new RuntimeException(e.getCause());
  }
catch (  Exception e) {
  }
  return null;
}

public static Object readProperty ( Object bean , PropertyDescriptor descriptor ) { try { Method readMethod = descriptor . getReadMethod ( ) ; if ( readMethod == null ) { throw new IllegalArgumentException ( String . format ( "%s property does not have a read method." , descriptor . getName ( ) ) ) ; } if ( ! readMethod . isAccessible ( ) ) { readMethod . setAccessible ( true ) ; } return readMethod . invoke ( bean ) ; } catch ( InvocationTargetException e ) { throw new RuntimeException ( e . getCause ( ) ) ; } catch ( Exception e ) { } return null ; }
returns the contents of the given property for the given bean .
