public static boolean setProperty ( Object target , String name , Object value ) { try { for ( PropertyDescriptor pd : Introspector . getBeanInfo ( target . getClass ( ) ) . getPropertyDescriptors ( ) ) { if ( pd . getWriteMethod ( ) != null && pd . getName ( ) . equals ( name ) ) { pd . getWriteMethod ( ) . invoke ( target , value ) ; return true ; } } } catch ( Exception e ) { throw new RuntimeException ( e ) ; } return false ; }
Set the property identified by name to the provided value .