Is it possible to find all kotlin
classes in a given package?
I also need only annotated classes but it's not a big deal. Any suggestions ?
Is it possible to find all kotlin
classes in a given package?
I also need only annotated classes but it's not a big deal. Any suggestions ?
由于类加载器的实现,JVM上的Kotlin在这方面与Java遇到了相同的问题.
Class loaders are not required to tell the VM which classes it can provide, instead they are just handed requests for classes, and have to return a class or throw an exception.
来源及更多信息:Can you find all classes in a package using reflection?
为了总结链接线程,有许多解决方案允许您判断当前的类路径.
ClassPath
个,返回ClassInfo
个POJO,这对于你的用例来说还不够,但是知道番石榴几乎在任何地方都是有用的.