dimanche 12 novembre 2023

Check at runtime whether a class is part of the code or part of one of the dependencies

I am working on an engine which uses the Java Reflect library to get methods of classes and their super classes. For the analysis, I need to know which of the methods are inherited by a super class, and whether the super class is part of one of the libraries or if the class is part of the project itself. Is there any way to determine this?

I tried to use the classloader, but I either don't know which is the correct way of doing so or it doesn't work (what I rather think), cause the classloader can also load classes of the dependency.

Furthermore, it can be the case that a project has many modules as well as packages, which makes it (in my opportunity, but maybe I'm wrong) impossible to use the package, which the class is part of.





Aucun commentaire:

Enregistrer un commentaire