org.peaseplate.locator
Class AbstractLocator

java.lang.Object
  extended by org.peaseplate.locator.AbstractLocator
All Implemented Interfaces:
java.io.Serializable, Locator
Direct Known Subclasses:
AbstractURLBasedLocator

public abstract class AbstractLocator
extends java.lang.Object
implements Locator

A abstract implementation of a locator.

See Also:
Serialized Form

Constructor Summary
AbstractLocator(ResourceKey key)
          Create the locator with the specified key
AbstractLocator(java.lang.String name, java.util.Locale locale, java.lang.String encoding)
          Create the locator with the specified name locale and encoding
 
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.
 void setRawSize(java.lang.Long rawSize)
          Sets the raw size
 void setTimestamp(java.lang.Long timestamp)
          Sets the timestamp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.peaseplate.locator.Locator
isOutdated, toString
 

Constructor Detail

AbstractLocator

public AbstractLocator(java.lang.String name,
                       java.util.Locale locale,
                       java.lang.String encoding)
                throws java.lang.IllegalArgumentException
Create the locator with the specified name locale and encoding

Parameters:
name - the name
locale - the locale
encoding - the encoding
Throws:
java.lang.IllegalArgumentException - if the name is null

AbstractLocator

public AbstractLocator(ResourceKey key)
                throws java.lang.IllegalArgumentException
Create the locator with the specified key

Parameters:
key - the key
Throws:
java.lang.IllegalArgumentException - if the key is null
Method Detail

getKey

public ResourceKey getKey()
Description copied from interface: Locator
Returns the key

Specified by:
getKey in interface Locator
Returns:
the key
See Also:
Locator.getKey()

getTimestamp

public java.lang.Long getTimestamp()
Description copied from interface: Locator
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.

Specified by:
getTimestamp in interface Locator
Returns:
the timestamp, or null if not specified
See Also:
Locator.getTimestamp()

setTimestamp

public void setTimestamp(java.lang.Long timestamp)
Description copied from interface: Locator
Sets the timestamp

Specified by:
setTimestamp in interface Locator
Parameters:
timestamp - the timestamp, may be null
See Also:
Locator.setTimestamp(java.lang.Long)

getRawSize

public java.lang.Long getRawSize()
Description copied from interface: Locator
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.

Specified by:
getRawSize in interface Locator
Returns:
the raw size, or null if not specified
See Also:
Locator.getRawSize()

setRawSize

public void setRawSize(java.lang.Long rawSize)
Description copied from interface: Locator
Sets the raw size

Specified by:
setRawSize in interface Locator
Parameters:
rawSize - the raw size, may be null
See Also:
Locator.setRawSize(java.lang.Long)


Copyright © 2008. All Rights Reserved.