public static void getSuperTypeParameterMap ( JvmDeclaredType type , Map < String , JvmTypeReference > mapping ) { for ( final JvmTypeReference superTypeReference : type . getSuperTypes ( ) ) { if ( superTypeReference instanceof JvmParameterizedTypeReference ) { final JvmParameterizedTypeReference parameterizedTypeReference = ( JvmParameterizedTypeReference ) superTypeReference ; final JvmType st = superTypeReference . getType ( ) ; if ( st instanceof JvmTypeParameterDeclarator ) { final JvmTypeParameterDeclarator superType = ( JvmTypeParameterDeclarator ) st ; int i = 0 ; for ( final JvmTypeParameter typeParameter : superType . getTypeParameters ( ) ) { mapping . put ( typeParameter . getIdentifier ( ) , parameterizedTypeReference . getArguments ( ) . get ( i ) ) ; ++ i ; } } } } }
Extract the mapping between the type parameters declared within the super types and the type parameters arguments that are declared within the given type .