|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sonatype.guice.bean.reflect.URLClassSpace
public final class URLClassSpace
ClassSpace backed by a strongly-referenced ClassLoader and a URL class path.
| Constructor Summary | |
|---|---|
URLClassSpace(java.lang.ClassLoader loader)
Creates a ClassSpace backed by a ClassLoader and its default class path.For URLClassLoaders this is their expanded Class-Path; otherwise it is empty. |
|
URLClassSpace(java.lang.ClassLoader loader,
java.net.URL[] path)
Creates a ClassSpace backed by a ClassLoader with a custom class path. |
|
| Method Summary | |
|---|---|
DeferredClass<?> |
deferLoadClass(java.lang.String name)
Defers loading of the named class from the surrounding class space. |
boolean |
equals(java.lang.Object rhs)
|
java.util.Enumeration<java.net.URL> |
findEntries(java.lang.String path,
java.lang.String glob,
boolean recurse)
Queries local class space content for entries matching the given pattern. |
java.net.URL |
getResource(java.lang.String name)
Queries the surrounding class space for the resource with the given name. |
java.util.Enumeration<java.net.URL> |
getResources(java.lang.String name)
Queries the surrounding class space for all resources with the given name. |
java.net.URL[] |
getURLs()
|
int |
hashCode()
|
java.lang.Class<?> |
loadClass(java.lang.String name)
Loads the named class from the surrounding class space. |
boolean |
loadedClass(java.lang.Class<?> clazz)
Determines whether the given class was loaded by this particular class space. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public URLClassSpace(java.lang.ClassLoader loader)
ClassSpace backed by a ClassLoader and its default class path.URLClassLoaders this is their expanded Class-Path; otherwise it is empty.
loader - The class loader to use when getting/finding resources
public URLClassSpace(java.lang.ClassLoader loader,
java.net.URL[] path)
ClassSpace backed by a ClassLoader with a custom class path.
loader - The class loader to use when getting resourcespath - The class path to use when finding resourcesgetResources(String),
findEntries(String, String, boolean)| Method Detail |
|---|
public java.lang.Class<?> loadClass(java.lang.String name)
ClassSpace
loadClass in interface ClassSpacename - The class name
ClassLoader.loadClass(String)public DeferredClass<?> deferLoadClass(java.lang.String name)
ClassSpace
deferLoadClass in interface ClassSpacename - The class name
ClassLoader.loadClass(String)public java.net.URL getResource(java.lang.String name)
ClassSpace
getResource in interface ClassSpacename - The resource name
null if it wasn't foundClassLoader.getResource(String)public java.util.Enumeration<java.net.URL> getResources(java.lang.String name)
ClassSpace
getResources in interface ClassSpacename - The resource name
ClassLoader.getResources(String)
public java.util.Enumeration<java.net.URL> findEntries(java.lang.String path,
java.lang.String glob,
boolean recurse)
ClassSpace
findEntries in interface ClassSpacepath - The initial search directory; for example "META-INF"glob - The filename glob pattern; for example "*.xml"recurse - If true recurse into sub-directories; otherwise only search initial directory
Bundle.findEntries(String, String, boolean)public boolean loadedClass(java.lang.Class<?> clazz)
ClassSpace
loadedClass in interface ClassSpaceclazz - The class
true if this space loaded the class; otherwise falsepublic java.net.URL[] getURLs()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object rhs)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||