private Object tryInitiatingObject ( String targetType , String initMethodName , List < Object > fieldObjects ) throws TransformationOperationException { Class < ? > targetClass = loadClassByName ( targetType ) ; try { if ( initMethodName == null ) { return initiateByConstructor ( targetClass , fieldObjects ) ; } else { return initiateByMethodName ( targetClass , initMethodName , fieldObjects ) ; } } catch ( Exception e ) { String message = "Unable to create the desired object. The instantiate operation will be ignored." ; message = String . format ( message , targetType ) ; getLogger ( ) . error ( message ) ; throw new TransformationOperationException ( message , e ) ; } }
Try to perform the actual initiating of the target class object . Returns the target class object or throws a TransformationOperationException if something went wrong .