boolean attemptSetPropertyValue ( final String propName , final Object value , final Interpreter interp ) throws UtilEvalError { final String accessorName = Reflect . accessorName ( Reflect . SET_PREFIX , propName ) ; Object val = Primitive . unwrap ( value ) ; final Class < ? > [ ] classArray = new Class < ? > [ ] { val == null ? null : val . getClass ( ) } ; final BshMethod m = this . getMethod ( accessorName , classArray ) ; if ( m != null ) try { this . invokeMethod ( accessorName , new Object [ ] { value } , interp ) ; // m.invoke(new Object[] {value}, interp); return true ; } catch ( final EvalError ee ) { throw new UtilEvalError ( "'This' property accessor threw exception: " + ee . getMessage ( ) , ee ) ; } return false ; }
If a writable property exists for the given name set it and return true otherwise do nothing and return false .