Class ClassEnumerator


  • public class ClassEnumerator
    extends java.lang.Object
    Taken and adapted from here
    • Constructor Summary

      Constructors 
      Constructor Description
      ClassEnumerator()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.SortedSet<java.lang.String> getClassesForPackage​(java.lang.Package pkg)
      Return all the classes in this package recursively.
      static java.util.SortedSet<java.lang.String> getClassesForPackage​(java.lang.Package pkg, java.lang.ClassLoader classLoader)
      Return all the classes in this package recursively.
      • Methods inherited from class java.lang.Object

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

      • ClassEnumerator

        public ClassEnumerator()
    • Method Detail

      • getClassesForPackage

        public static java.util.SortedSet<java.lang.String> getClassesForPackage​(java.lang.Package pkg)
        Return all the classes in this package recursively. The class loader of the ClassEnumerator class is used
        Parameters:
        pkg - the searched package
        Returns:
        list of full class names
      • getClassesForPackage

        public static java.util.SortedSet<java.lang.String> getClassesForPackage​(java.lang.Package pkg,
                                                                                 java.lang.ClassLoader classLoader)
        Return all the classes in this package recursively.
        Parameters:
        pkg - the searched package
        classLoader - class loader where to look for classes
        Returns:
        list of full class names