List<Type> sourceTypeParams = method.getSourceParameters().iterator().next().getType().getTypeParameters();
List<Type> resultTypeParams = method.getResultType().getTypeParameters();
// find mapping method or conversion for key
Type keySourceType = sourceTypeParams.get( 0 );
Type keyTargetType = resultTypeParams.get( 0 );
Assignment keyAssignment = ctx.getMappingResolver().getTargetAssignment(
method,
"map key",
keySourceType,
keyTargetType,
null, // there is no targetPropertyName
keyDateFormat,
keyQualifiers,
"entry.getKey()"
);
if ( keyAssignment == null ) {
String message = String.format(
"Can't create implementation of method %s. Found no method nor "
+ "built-in conversion for mapping source key type to target key type.", method
);
ctx.getMessager().printMessage( Diagnostic.Kind.ERROR, message, method.getExecutable() );
}
// find mapping method or conversion for value
Type valueSourceType = sourceTypeParams.get( 1 );
Type valueTargetType = resultTypeParams.get( 1 );
Assignment valueAssignment = ctx.getMappingResolver().getTargetAssignment(
method,
"map value",
valueSourceType,