Is there some way to tell java to think that Object passed to reflected method implements interface of input attribute of method?
public class Debuger /*implements IDebuger*/{
...
}
and this Debuger I need to use in reflected method someDocument.attachDebuger(IDebuger).
I know the structure of IDebuger interface, but I cant just simply write implements IDebuger since it is not in my project.
I want to be able to call something similar
Debuger dbg = new Debuger();
Class theClassINeedToImplement = ...;
Object document = ...;
Class docClass = document.GetClass();
/*
HERE call something like
Object Idbg = theClassINeedToImplement.ForceImplementInterface(dbg);
*/
Method m = docClass.getMethod("attachDebuger", theClassINeedToImplement);
m.invoke(document, Idbg);