Class ClassLoaderUtil


  • public class ClassLoaderUtil
    extends java.lang.Object
    Utility class for loading classes using multiple class loaders.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Class<?> loadClass​(java.lang.String className, java.lang.ClassLoader... classLoaders)
      Attempts to load the specified class using the given class loaders in order.
      • Methods inherited from class java.lang.Object

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

      • loadClass

        public static java.lang.Class<?> loadClass​(java.lang.String className,
                                                   java.lang.ClassLoader... classLoaders)
                                            throws java.lang.ClassNotFoundException
        Attempts to load the specified class using the given class loaders in order.
        Parameters:
        className - the fully qualified class name
        classLoaders - the class loaders to attempt, in order
        Returns:
        the loaded class
        Throws:
        java.lang.ClassNotFoundException - if the class cannot be found by any of the loaders