|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.util.resource.ClassLocator
public class ClassLocator
The locator searches the current thread's context class loader, and then this class's class loader.
It is important to use this locator if you want to load something in other jar files.
Besides Locator, it also provides additional methods,
such as getResources(java.lang.String).
Since this locator is used frequently, Locators.getDefault()
is provided to return an instance of this class,
| Nested Class Summary | |
|---|---|
static class |
ClassLocator.Resource
An item of the list returned by getDependentXMLResources(java.lang.String, java.lang.String, java.lang.String). |
| Constructor Summary | |
|---|---|
ClassLocator()
|
|
| Method Summary | |
|---|---|
boolean |
equals(Object o)
|
List |
getDependentXMLResources(String name,
String elName,
String elDepends)
Returns a list of resources ( ClassLocator.Resource) after resolving
the dependence. |
String |
getDirectory()
Always returns null. |
URL |
getResource(String name)
Finds the resource with the given name. |
InputStream |
getResourceAsStream(String name)
Returns an input stream for reading the specified resource. |
Enumeration |
getResources(String name)
Returns an enumeration of resources. |
int |
hashCode()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClassLocator()
| Method Detail |
|---|
public Enumeration getResources(String name)
throws IOException
getDependentXMLResources(java.lang.String, java.lang.String, java.lang.String), it doesn't resolve the dependence
among the resouces.
name - the resouce name, such as "metainfo/i3-com.xml".
IOException
public List getDependentXMLResources(String name,
String elName,
String elDepends)
throws IOException
ClassLocator.Resource) after resolving
the dependence.
The resource is returned in the format of ClassLocator.Resource
To resolve the dependence, it assumes each resource has two element whose name is identified by elName and elDepends. The elName element specifies the unique name of each resource. The elDepends element specifies a list of names of resources that this resource depends on. If not found, it assumes it could be loaded first.
name - the resouce name, such as "metainfo/i3-comp.xml".elName - the element used to specify the name.elDepends - the element used to specify the dependence.
ClassLocator.Resource of the specified name.
IOExceptionpublic String getDirectory()
getDirectory in interface Locatorpublic URL getResource(String name)
Locator
getResource in interface Locatorpublic InputStream getResourceAsStream(String name)
Locator
getResourceAsStream in interface Locatorpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object o)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||