Class ClassPathUtils

java.lang.Object
com.querydsl.codegen.ClassPathUtils

public final class ClassPathUtils extends Object
ClassPathUtils provides classpath scanning functionality
Author:
tiwe
  • Method Details

    • scanPackage

      public static Set<Class<?>> scanPackage(ClassLoader classLoader, Package pkg) throws IOException
      Return the classes from the given package and subpackages using the supplied classloader
      Parameters:
      classLoader - classloader to be used
      pkg - package to scan
      Returns:
      set of found classes
      Throws:
      IOException
    • scanPackage

      public static Set<Class<?>> scanPackage(ClassLoader classLoader, String pkg) throws IOException
      Return the classes from the given package and subpackages using the supplied classloader
      Parameters:
      classLoader - classloader to be used
      pkg - package to scan
      Returns:
      set of found classes
      Throws:
      IOException
    • safeClassForName

      public static Class<?> safeClassForName(ClassLoader classLoader, String className)
      Get the class for the given className via the given classLoader
      Parameters:
      classLoader - classloader to be used
      className - fully qualified class name
      Returns:
      Class instance matching the class name or null if not found