public Object transformObject ( TransformationDescription description , Object source , Object target ) throws InstantiationException , IllegalAccessException , ClassNotFoundException { checkNeededValues ( description ) ; Class < ? > sourceClass = modelRegistry . loadModel ( description . getSourceModel ( ) ) ; Class < ? > targetClass = modelRegistry . loadModel ( description . getTargetModel ( ) ) ; if ( ! sourceClass . isAssignableFrom ( source . getClass ( ) ) ) { throw new IllegalArgumentException ( "The given source object does not match the given description" ) ; } this . source = source ; if ( target == null ) { this . target = targetClass . newInstance ( ) ; } else { this . target = target ; } for ( TransformationStep step : description . getTransformingSteps ( ) ) { performTransformationStep ( step ) ; } return this . target ; }
Performs a transformation based merge of the given source object with the given target object based on the given TransformationDescription .