|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jaxfront.core.util.io.classloader.ClassScope
public abstract class ClassScope
A simple static API for listing classes loaded in a JVM. getClassLocation(Class) from http://www.javaworld.com/javaworld/javaqa/2003-07/01-qa-0711-classsrc.html also thrown in for a good measure. See individual methods for further details.
NOTE: use for testing/debugging only.
| Method Summary | |
|---|---|
static java.lang.String |
dump()
|
static java.lang.String |
dump(java.lang.ClassLoader[] loaders)
|
static java.lang.ClassLoader[] |
getCallerClassLoaderTree()
Returns the class loader set "relevant" to the calling class, as described in the article. |
static java.net.URL |
getClassLocation(java.lang.Class cls)
Given a Class object, attempts to find its .class location [returns null if no such definiton could be found]. |
static java.lang.Class[] |
getLoadedClasses(java.lang.ClassLoader loader)
Given a class loader instance, returns all classes currently loaded by that class loader. |
static java.lang.Class[] |
getLoadedClasses(java.lang.ClassLoader[] loaders)
A convenience multi-loader version of getLoadedClasses(ClassLoader). |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static java.lang.String dump()
public static java.lang.String dump(java.lang.ClassLoader[] loaders)
public static java.lang.ClassLoader[] getCallerClassLoaderTree()
java.lang.RuntimeException - if the caller context resolver could not be instantiatedpublic static java.net.URL getClassLocation(java.lang.Class cls)
public static java.lang.Class[] getLoadedClasses(java.lang.ClassLoader loader)
defining - class loader to inspect [may not be null]
java.lang.RuntimeException - if the "classes" field hack is not possible in this JREpublic static java.lang.Class[] getLoadedClasses(java.lang.ClassLoader[] loaders)
getLoadedClasses(ClassLoader).
an - array of defining class loaders to inspect [may not be null]
java.lang.RuntimeException - if the "classes" field hack is not possible in this JRE
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||