public static void setObjectProperty ( final Object obj , final String propertyName , final String propertyValue , final boolean ignoreNonExisting ) { try { Method method = obj . getClass ( ) . getMethod ( "set" + Character . toUpperCase ( propertyName . charAt ( 0 ) ) + propertyName . substring ( 1 ) , new Class [ ] { String . class } ) ; method . invoke ( obj , propertyValue ) ; } catch ( Exception e ) { String msg = "failed to set property '" + propertyName + "' to value '" + propertyValue + "' for object " + obj ; if ( ignoreNonExisting ) { LOG . info ( msg ) ; } else { LOG . warning ( msg ) ; throw new IllegalArgumentException ( e ) ; } } }
Sets the object property .