I am creating a modular app. The following is my design:
my_app_package
PluginsLoader.java
plugins_package
plugin_A
Start.java
plugin_a_inner_package_1
plugin_a_inner_package_2
plugin_a_inner_package _3
plugin_B
Start.java
plugin_b_inner_package_1
plugin_b_inner_package_2
plugin_C
Start.java
plugin_c_inner_package_1
I would like to recursively go through all the Start.java
classes in the roots of plugins_package root packages, but not go through any of the pluginA, pluinB etc etc*_inner_packages.
How can I do this efficiently.
I know my_app_package.plugins_package.*.Start.java
will not work, but it draws on the idea of what I'm seeking.
Thank you all in advance.
UPDATE
I would like to recursively go through all the Start.java classes in the roots of plugins_package packages, but not go through any of the pluginA, pluinB etc etc _inner_packages like plugin_a_inner_package_1
. With Java Reflections, I'll wind up going through everything in the plugins_package.
Reflections reflections = new Reflections("my_app_package.plugins_package");
Set<Class<? extends Object>> allClasses = reflections.getSubTypesOf(Object.class);
I would only like to go through the root package of a plugin package, say plugins_package.plugin_A then walk out with the the **Start class**
, then repeat this for all other plugin packages like plugin_B, plugin_C, etc, etc.