org.peaseplate.locator
Interface Locator

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
MessagesLocator, TemplateLocator
All Known Implementing Classes:
AbstractClassLoaderLocator, AbstractLocator, AbstractURLBasedLocator, ClassLoaderMessagesLocator, ClassLoaderTemplateLocator, InMemoryTemplateLocator, URLBasedMessagesLocator, URLBasedTemplateLocator

public interface Locator
extends java.io.Serializable

A locator is a reference to a resource. It usually can load the resource and check if it is outdated. There is no definition for the load method, since it returns different types of objects with each type of locator.


Method Summary
 ResourceKey getKey()
          Returns the key
 java.lang.Long getRawSize()
          Returns the raw size of the resource.
 java.lang.Long getTimestamp()
          Returns the timestamp of the resource.
 boolean isOutdated()
          Returns true if the resource described by the locator got updated and needs to be reloaded
 void setRawSize(java.lang.Long rawSize)
          Sets the raw size
 void setTimestamp(java.lang.Long timestamp)
          Sets the timestamp
 java.lang.String toString()
          A meaningful representation of the locator, mainly used for textual output e.g. in error messages
 

Method Detail

getKey

ResourceKey getKey()
Returns the key

Returns:
the key

getTimestamp

java.lang.Long getTimestamp()
Returns the timestamp of the resource. Used for checking updates to the source of the resource. (usually this is the last modified date of the file). If there is no possibility to support such a timestamp, just return null.

Returns:
the timestamp, or null if not specified

setTimestamp

void setTimestamp(java.lang.Long timestamp)
Sets the timestamp

Parameters:
timestamp - the timestamp, may be null

getRawSize

java.lang.Long getRawSize()
Returns the raw size of the resource. Used for checking updates to the source of the resource. (usually this is the size of the file). If there is not possibility to support such a size, just return null.

Returns:
the raw size, or null if not specified

setRawSize

void setRawSize(java.lang.Long rawSize)
Sets the raw size

Parameters:
rawSize - the raw size, may be null

isOutdated

boolean isOutdated()
Returns true if the resource described by the locator got updated and needs to be reloaded

Returns:
true if the resource should get reloaded

toString

java.lang.String toString()
A meaningful representation of the locator, mainly used for textual output e.g. in error messages

Overrides:
toString in class java.lang.Object
Returns:
a meaningful representation of the locator
See Also:
ResourceKey.toString()


Copyright © 2008. All Rights Reserved.