Package com.vladmihalcea.hibernate.util
Class ClassLoaderUtils
- java.lang.Object
-
- com.vladmihalcea.hibernate.util.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 loadablestatic java.lang.ClassLoader
getClassLoader()
Load the available ClassLoaderstatic java.net.URL
getResource(java.lang.String resourceName)
Get the resource URLstatic java.io.InputStream
getResourceAsStream(java.lang.String resourceName)
Get the resource InputStreamstatic <T> java.lang.Class<T>
loadClass(java.lang.String className)
Load the Class denoted by the given string representation
-
-
-
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
-
-