public class ClassLoaderUtil
extends java.lang.Object
Constructor and Description |
---|
ClassLoaderUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
classLocation(java.lang.Class clazz)
Returns location of the class.
|
static java.io.InputStream |
getClassAsStream(java.lang.Class clazz)
Opens a class of the specified name for reading using class classloader.
|
static java.io.InputStream |
getClassAsStream(java.lang.String className)
Opens a class of the specified name for reading.
|
static java.io.InputStream |
getClassAsStream(java.lang.String className,
java.lang.ClassLoader classLoader)
Opens a class of the specified name for reading using provided class loader.
|
static java.lang.String |
getClasspathItemBaseDir(java.io.File classpathItem)
Returns base folder for classpath item.
|
static java.util.jar.Manifest |
getClasspathItemManifest(java.io.File classpathItem)
Returns classpath item manifest or
null if not found. |
static java.lang.ClassLoader |
getContextClassLoader()
Returns thread context class loader.
|
static java.lang.ClassLoader |
getDefaultClassLoader()
Returns default class loader.
|
static java.io.File[] |
getDefaultClasspath()
Returns default classpath using
default classloader . |
static java.io.File[] |
getDefaultClasspath(java.lang.ClassLoader classLoader)
Returns default class path from all available
URLClassLoader
in classloader hierarchy. |
static java.lang.ClassLoader |
getSystemClassLoader()
Returns system class loader.
|
static java.lang.String |
joddLocation()
Returns Jodd
location . |
static java.lang.Class |
loadClass(java.lang.String className)
Loads a class using default class loader strategy.
|
static java.lang.Class |
loadClass(java.lang.String className,
java.lang.ClassLoader classLoader)
Loads a class using default class loader strategy.
|
public static java.lang.ClassLoader getDefaultClassLoader()
threads context class loader
.
If this one is null
, then class loader of the caller class is returned.public static java.lang.ClassLoader getContextClassLoader()
public static java.lang.ClassLoader getSystemClassLoader()
public static java.util.jar.Manifest getClasspathItemManifest(java.io.File classpathItem)
null
if not found.public static java.lang.String getClasspathItemBaseDir(java.io.File classpathItem)
public static java.io.File[] getDefaultClasspath()
default classloader
.public static java.io.File[] getDefaultClasspath(java.lang.ClassLoader classLoader)
URLClassLoader
in classloader hierarchy. The following is added to the classpath list:
URLClassLoader
(other URL protocols are ignored)public static java.io.InputStream getClassAsStream(java.lang.Class clazz) throws java.io.IOException
java.io.IOException
public static java.io.InputStream getClassAsStream(java.lang.String className) throws java.io.IOException
java.io.IOException
public static java.io.InputStream getClassAsStream(java.lang.String className, java.lang.ClassLoader classLoader) throws java.io.IOException
java.io.IOException
public static java.lang.Class loadClass(java.lang.String className) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
DefaultClassLoaderStrategy
public static java.lang.Class loadClass(java.lang.String className, java.lang.ClassLoader classLoader) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
DefaultClassLoaderStrategy
public static java.lang.String classLocation(java.lang.Class clazz)
public static java.lang.String joddLocation()
location
.classLocation(java.lang.Class)
Copyright © 2003-present Jodd Team