如何获取 kotlin 中构造函数参数的 KClass?
我想创建某种依赖注入系统,获取需要实例化的类列表以创建某种依赖关系树。为此,我想获取所有类,首先找到它们的“外部依赖项”(不包含在树中的类)。
我的问题是:在kotlin中,构造函数(KFunction)的参数被保存为我不知道如何获取我真正需要的类的类型。
所以问题是:如何获取kotlin中构造函数参数的实际KClass?
I want to create some sort of dependency injection system taking a list of classes that need to be instantiated to create a sort of dependency tree. For that I want to take all the classes and first of all find their "external dependencies" (the classes that are not contained in the tree).
My problem is: In kotlin, the parameters of a constructor (KFunction) are saved as types of which I don't know how to get the classes which I really need.
So the question is: How can I get the actual KClasses of constructor parameters in kotlin?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论