public void setProperty ( Object object , Object newValue ) { MetaMethod setter = getSetter ( ) ; if ( setter == null ) { if ( field != null && ! Modifier . isFinal ( field . getModifiers ( ) ) ) { field . setProperty ( object , newValue ) ; return ; } throw new GroovyRuntimeException ( "Cannot set read-only property: " + name ) ; } newValue = DefaultTypeTransformation . castToType ( newValue , getType ( ) ) ; setter . invoke ( object , new Object [ ] { newValue } ) ; }
Set the property on the given object to the new value .