Class SubclassFinder

java.lang.Object
tk.airshipcraft.commonlib.utils.classes.SubclassFinder

public class SubclassFinder extends Object
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

    Constructors
    Constructor
    Description
    SubclassFinder(Class<?> superclass)
    Constructs a new SubclassFinder that will search for subclasses of the provided superclass.
  • Method Summary

    Modifier and Type
    Method
    Description
    Searches through all loaded Bukkit plugins and retrieves classes that are subclasses of the superclass associated with this SubclassFinder.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SubclassFinder

      public SubclassFinder(Class<?> superclass)
      Constructs a new SubclassFinder that will search for subclasses of the provided superclass.
      Parameters:
      superclass - The parent class for which subclasses will be found.
  • Method Details

    • getSubclasses

      public List<Class<?>> getSubclasses()
      Searches through all loaded Bukkit plugins and retrieves classes that are subclasses of the superclass associated with this SubclassFinder. Only classes that are direct descendants and not the superclass itself are returned.
      Returns:
      A list of Class objects representing the found subclasses.