private void initializeProperty ( Class < ? > type , PropertyDescriptor pd , Object oldInstance , Encoder encoder ) throws Exception { Method getter = pd . getReadMethod ( ) ; Method setter = pd . getWriteMethod ( ) ; if ( getter != null && setter != null ) { Expression oldGetExpression = new Expression ( oldInstance , getter . getName ( ) , new Object [ ] { } ) ; Object oldValue = oldGetExpression . getValue ( ) ; Statement setStatement = new Statement ( oldInstance , setter . getName ( ) , new Object [ ] { oldValue } ) ; encoder . writeStatement ( setStatement ) ; } }
Write the statement to initialize the specified property of the given Java Bean Type based on the given instance using the given encoder