org.apache.tapestry.resource
Class AbstractResourceLocation

java.lang.Object
  extended by org.apache.tapestry.resource.AbstractResourceLocation
All Implemented Interfaces:
IResourceLocation
Direct Known Subclasses:
ClasspathResourceLocation, ContextResourceLocation

public abstract class AbstractResourceLocation
extends Object
implements IResourceLocation


Constructor Summary
protected AbstractResourceLocation(String path)
           
protected AbstractResourceLocation(String path, Locale locale)
           
 
Method Summary
protected abstract  IResourceLocation buildNewResourceLocation(String path)
           
 boolean equals(Object obj)
          Returns true if the other object is an instance of the same class, and the paths are equal.
 Locale getLocale()
          Returns the locale for which this resource has been localized or null if the resource has not been localized.
 String getName()
          Returns the file name portion of the resource location.
 String getPath()
          Returns the path that represents the resource.
 IResourceLocation getRelativeLocation(String name)
          Returns at a relative location to this resource.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.tapestry.IResourceLocation
getLocalization, getResourceURL
 

Constructor Detail

AbstractResourceLocation

protected AbstractResourceLocation(String path)

AbstractResourceLocation

protected AbstractResourceLocation(String path,
                                   Locale locale)
Method Detail

getName

public String getName()
Description copied from interface: IResourceLocation
Returns the file name portion of the resource location.

Specified by:
getName in interface IResourceLocation

getRelativeLocation

public IResourceLocation getRelativeLocation(String name)
Description copied from interface: IResourceLocation
Returns at a relative location to this resource. The new resource may or may not exist; this can be determined via IResourceLocation.getResourceURL().

Specified by:
getRelativeLocation in interface IResourceLocation
Parameters:
name - name of new resource, possibly as a relative path, or as an absolute path (starting with a slash).

getPath

public String getPath()
Description copied from interface: IResourceLocation
Returns the path that represents the resource. This should only be used when the type of resource is known.

Specified by:
getPath in interface IResourceLocation

getLocale

public Locale getLocale()
Description copied from interface: IResourceLocation
Returns the locale for which this resource has been localized or null if the resource has not been localized. This should only be used when the type of resource is known. This locale is the same or more general than the locale for which localization was requested. For example, if the requested locale was en_US, but only the file Home_en was found, this locale returned would be en.

Specified by:
getLocale in interface IResourceLocation

buildNewResourceLocation

protected abstract IResourceLocation buildNewResourceLocation(String path)

equals

public boolean equals(Object obj)
Returns true if the other object is an instance of the same class, and the paths are equal.

Overrides:
equals in class Object