public class Loader extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
IGNORE_TCL_PROPERTY_NAME
|
| Constructor and Description |
|---|
Loader()
|
| Modifier and Type | Method and Description |
|---|---|
static ClassLoader |
getClassLoaderAsPrivileged(Class
Returns the class loader of clazz in an access privileged section.
|
static ClassLoader |
getClassLoaderOfClass(Class
Return the class loader which loaded the class passed as argument.
|
static ClassLoader |
getClassLoaderOfObject(Object
Get the class loader of the object passed as argument.
|
static URL |
getResource(String
Search for a resource using the classloader passed as parameter.
|
static URL |
getResourceBySelfClassLoader(String
Attempt to find a resource by using the classloader that loaded this class, namely Loader.class.
|
static Set |
getResourceOccurrenceCount(String
Compute the number of occurrences a resource can be found by a class loader.
|
static ClassLoader |
getTCL()
Get the Thread Context Loader which is a JDK 1.2 feature.
|
static Class |
loadClass(String
If running under JDK 1.2 load the specified class using the
Thread
contextClassLoader if that fails try Class.forname.
|
static Class |
loadClass(String
|
public static final StringIGNORE_TCL_PROPERTY_NAME
public static Set<URL > getResourceOccurrenceCount(String resource, ClassLoader classLoader) throws IOException
resource -
classLoader -
IOException -
public static URLgetResource(String resource, ClassLoader classLoader)
resource - the resource name to look for
classLoader - the classloader used for the search
public static URLgetResourceBySelfClassLoader(String resource)
resource -
public static ClassLoadergetTCL()
null.
public static Class<?> loadClass(String clazz, Context context) throws ClassNotFoundException
ClassNotFoundException
public static ClassLoadergetClassLoaderOfObject(Object o)
o -
public static ClassLoadergetClassLoaderAsPrivileged(Class <?> clazz)
clazz -
public static ClassLoadergetClassLoaderOfClass(Class <?> clazz)
clazz -
public static Class<?> loadClass(String clazz) throws ClassNotFoundException
Thread
contextClassLoader if that fails try Class.forname. Under JDK 1.1 only Class.forName is used.
ClassNotFoundException