在Java中,我通常通过反射来调用一个方法,该方法通过使用以下方法构建我的参数来使用a作为参数:interface
Method method = theClass.getMethod("methodName", new Class[]{ IAnyInterface.class });
但是我不知道当 嵌套在私有类中时如何执行此操作:,其中是:interfaceJSomething.INestedInterfaceJSomethingprivate
private class JSomething {
public void init(INestedInterface iSomething) {
...
}
public interface INestedInterface {
public void notify();
}
...
}
在这里使用这个甚至不能编译,因为接口是不可访问的:
Method method = theClass.getMethod("init", new Class[]{JSomething.INestedInterface.class});
我已经创建了一个准备被调用的代理处理程序,但是当我无法使用嵌套接口名称时,我被困在尝试构建参数中,有什么建议吗?class
慕姐4208626
相关分类