I'm trying to get all the classes of a particular package, I've seen some code that does this, however, it just takes the classes that are part of the project itself, basically does not use reflection and yes it does a search for .class
files in the directory, in my case, I need to get the .class
of a jar that is part of my project.
Something like:
List<Class> clazz = ReflectionUtil.getClassFromPackage("org.springframework.util");
List<Class> clazz = ReflectionUtil.getClassFromPackage("com.meuprojeto.meupacotebase");
I've already tried:
They talked about this library link
but has the following code:
Reflections reflections = new Reflections("my.project");
Set<Class<? extends SomeType>> subTypes = reflections.getSubTypesOf(SomeType.class);
Now, I need to get the class list, I do not want to specify the type of class I need
I think this would or should be basic with reflection of Java.