private SetterTarget findSetterTarget ( String path ) throws NoSuchMethodException , IllegalAccessException , InvocationTargetException { String [ ] _accessStack = path . split ( REGEXP__CHAR_DOT ) ; if ( 0 == _accessStack . length ) { throw new IllegalArgumentException ( path ) ; } int _setterIndex = _accessStack . length - 1 ; Object _toChange = getObject ( ) ; for ( int _index = 0 ; _index < _setterIndex ; _index ++ ) { String _getterName = computeGetterName ( _accessStack [ _index ] ) ; Method _getter = _toChange . getClass ( ) . getMethod ( _getterName , ( Class < ? > [ ] ) null ) ; _toChange = _getter . invoke ( _toChange , ( Object [ ] ) null ) ; } String _setterName = computeSetterName ( _accessStack [ _setterIndex ] ) ; SetterTarget _target = new SetterTarget ( _toChange , _setterName ) ; return _target ; }
Find the object to change and the setter method name .