Class ClassLoaderUtils


  • public final class ClassLoaderUtils
    extends java.lang.Object
    ClassLoaderUtils - Class loading related utilities holder.
    Since:
    2.1.0
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ClassLoaderUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean findClass​(java.lang.String className)
      Find if Class denoted by the given string representation is loadable
      static java.lang.ClassLoader getClassLoader()
      Load the available ClassLoader
      static java.net.URL getResource​(java.lang.String resourceName)
      Get the resource URL
      static java.io.InputStream getResourceAsStream​(java.lang.String resourceName)
      Get the resource InputStream
      static <T> java.lang.Class<T> loadClass​(java.lang.String className)
      Load the Class denoted by the given string representation
      • Methods inherited from class java.lang.Object

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

      • ClassLoaderUtils

        private ClassLoaderUtils()
    • Method Detail

      • getClassLoader

        public static java.lang.ClassLoader getClassLoader()
        Load the available ClassLoader
        Returns:
        ClassLoader
      • loadClass

        public static <T> java.lang.Class<T> loadClass​(java.lang.String className)
                                                throws java.lang.ClassNotFoundException
        Load the Class denoted by the given string representation
        Type Parameters:
        T - class generic type
        Parameters:
        className - class string representation
        Returns:
        Class
        Throws:
        java.lang.ClassNotFoundException - if the class cannot be resolved
      • findClass

        public static boolean findClass​(java.lang.String className)
        Find if Class denoted by the given string representation is loadable
        Parameters:
        className - class string representation
        Returns:
        Class
      • getResource

        public static java.net.URL getResource​(java.lang.String resourceName)
        Get the resource URL
        Parameters:
        resourceName - resource name
        Returns:
        resource URL
      • getResourceAsStream

        public static java.io.InputStream getResourceAsStream​(java.lang.String resourceName)
        Get the resource InputStream
        Parameters:
        resourceName - resource name
        Returns:
        resource InputStream