|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jguiraffe.locators.AbstractLocator
net.sf.jguiraffe.locators.ClassPathLocator
public class ClassPathLocator
A specific Locator implementation that can obtain resources from
the class path.
This class is initialized with a resource name. The getURL()
method tries to find this resource from the class path (using the
class. No caching is performed; each
invocation of LocatorUtilsgetURL() will look up the resource. Because a
lookup takes the context class loader into account, multiple invocations of
getURL() may yield different results.
Instances of this class are created using the getInstance()
factory method. They are immutable and thus can be shared between multiple
threads.
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
Compares this object with another one. |
static ClassPathLocator |
getInstance(java.lang.String resourceName)
Returns a ClassPathLocator instance for the specified
resource name. |
java.lang.String |
getResourceName()
Returns the name of the resource represented by this locator. |
java.net.URL |
getURL()
Returns the URL for the represented resource. |
int |
hashCode()
Returns a hash code for this object. |
java.lang.String |
toString()
Returns a string representation of this object. |
| Methods inherited from class net.sf.jguiraffe.locators.AbstractLocator |
|---|
getFile, getInputStream |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public java.lang.String getResourceName()
public static ClassPathLocator getInstance(java.lang.String resourceName)
ClassPathLocator instance for the specified
resource name.
resourceName - the name of the resource (must not be null)
java.lang.IllegalArgumentException - if the resource name is nullpublic java.net.URL getURL()
locateResource()
method of LocatorUtils to find the resource on the
class path. If this fails, an exception is thrown.
LocatorException - if the resource URL cannot be obtainedpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode 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 | |||||||||