|
||||||||||
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(ClassLoader loader)
Creates a ClassSpace backed by a ClassLoader and its default class path.For URLClassLoader s this is their expanded Class-Path; otherwise it is empty. |
|
URLClassSpace(ClassLoader loader,
URL[] path)
Creates a ClassSpace backed by a ClassLoader with a restricted class path. |
Method Summary | |
---|---|
DeferredClass<?> |
deferLoadClass(String name)
Defers loading of the named class from the surrounding class space. |
boolean |
equals(Object rhs)
|
Enumeration<URL> |
findEntries(String path,
String glob,
boolean recurse)
Queries local class space content for entries matching the given pattern. |
URL |
getResource(String name)
Queries the surrounding class space for the resource with the given name. |
Enumeration<URL> |
getResources(String name)
Queries the surrounding class space for all resources with the given name. |
URL[] |
getURLs()
|
int |
hashCode()
|
Class<?> |
loadClass(String name)
Loads the named class from the surrounding class space. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public URLClassSpace(ClassLoader loader)
ClassSpace
backed by a ClassLoader
and its default class path.URLClassLoader
s this is their expanded Class-Path; otherwise it is empty.
loader
- The class loader to use when getting/finding resourcespublic URLClassSpace(ClassLoader loader, URL[] path)
ClassSpace
backed by a ClassLoader
with a restricted 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 Class<?> loadClass(String name)
ClassSpace
loadClass
in interface ClassSpace
name
- The class name
ClassLoader.loadClass(String)
public DeferredClass<?> deferLoadClass(String name)
ClassSpace
deferLoadClass
in interface ClassSpace
name
- The class name
ClassLoader.loadClass(String)
public URL getResource(String name)
ClassSpace
getResource
in interface ClassSpace
name
- The resource name
null
if it wasn't foundClassLoader.getResource(String)
public Enumeration<URL> getResources(String name)
ClassSpace
getResources
in interface ClassSpace
name
- The resource name
ClassLoader.getResources(String)
public Enumeration<URL> findEntries(String path, String glob, boolean recurse)
ClassSpace
findEntries
in interface ClassSpace
path
- 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 URL[] getURLs()
public int hashCode()
hashCode
in class Object
public boolean equals(Object rhs)
equals
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |