Class ClassWalker

java.lang.Object
xyz.dynxsty.dih4jda.util.ClassWalker

public class ClassWalker extends Object
A class that provides you with the ability to get all classes inside a specific package.
Since:
v1.6
  • Constructor Details

    • ClassWalker

      public ClassWalker(@Nonnull String packageName)
  • Method Details

    • getAllClasses

      @Nonnull public Set<Class<?>> getAllClasses() throws DIH4JDAException
      Gets all classes inside the given package and sub packages.
      Returns:
      An unmodifiable Set of classes inside the given package.
      Throws:
      DIH4JDAException
      Since:
      v1.6
    • getSubTypesOf

      @Nonnull public <T> Set<Class<? extends T>> getSubTypesOf(@Nonnull Class<T> type) throws DIH4JDAException
      Gets all classes in the given package and sub packages which extend the specified class.
      Parameters:
      type - The parent class to search for.
      Returns:
      An unmodifiable Set of classes which are assignable to the given type.
      Throws:
      DIH4JDAException
      Since:
      v1.6