Class SubclassFinder
java.lang.Object
tk.airshipcraft.commonlib.utils.classes.SubclassFinder
Provides functionality to search and retrieve subclasses of a given superclass dynamically.
This is particularly useful in Bukkit plugin development where plugins may define
multiple subclasses that extend common superclasses or interfaces.
- Since:
- 2023-05-31
- Version:
- 1.0.0
- Author:
- Locutusque
-
Constructor Summary
ConstructorsConstructorDescriptionSubclassFinder
(Class<?> superclass) Constructs a newSubclassFinder
that will search for subclasses of the provided superclass. -
Method Summary
Modifier and TypeMethodDescriptionSearches through all loaded Bukkit plugins and retrieves classes that are subclasses of the superclass associated with thisSubclassFinder
.
-
Constructor Details
-
SubclassFinder
Constructs a newSubclassFinder
that will search for subclasses of the provided superclass.- Parameters:
superclass
- The parent class for which subclasses will be found.
-
-
Method Details
-
getSubclasses
Searches through all loaded Bukkit plugins and retrieves classes that are subclasses of the superclass associated with thisSubclassFinder
. Only classes that are direct descendants and not the superclass itself are returned.- Returns:
- A list of
Class
objects representing the found subclasses.
-