| Method from org.apache.velocity.runtime.resource.Resource Detail: |
public Object getData() {
return data;
}
Get arbitrary data object that might be used
by the resource. |
public String getEncoding() {
return encoding;
}
get the encoding of this resource
for example, "ISO-8859-1" |
public long getLastModified() {
return lastModified;
}
Return the lastModifed time of this
resource. |
public String getName() {
return name;
}
Get the name of this template. |
public ResourceLoader getResourceLoader() {
return resourceLoader;
}
Return the template loader that pulled
in the template stream |
public boolean isSourceModified() {
return resourceLoader.isSourceModified(this);
}
|
abstract public boolean process() throws Exception, ResourceNotFoundException, ParseErrorException
Perform any subsequent processing that might need
to be done by a resource. In the case of a template
the actual parsing of the input stream needs to be
performed. |
public boolean requiresChecking() {
/*
* short circuit this if modificationCheckInterval == 0
* as this means "don't check"
*/
if (modificationCheckInterval < = 0 )
{
return false;
}
/*
* see if we need to check now
*/
return ( System.currentTimeMillis() >= nextCheck );
}
Is it time to check to see if the resource
source has been updated? |
public void setData(Object data) {
this.data = data;
}
Set arbitrary data object that might be used
by the resource. |
public void setEncoding(String encoding) {
this.encoding = encoding;
}
set the encoding of this resource
for example, "ISO-8859-1" |
public void setLastModified(long lastModified) {
this.lastModified = lastModified;
}
Set the last modified time for this
resource. |
public void setModificationCheckInterval(long modificationCheckInterval) {
this.modificationCheckInterval = modificationCheckInterval;
}
Set the modification check interval. |
public void setName(String name) {
this.name = name;
}
Set the name of this resource, for example
test.vm. |
public void setResourceLoader(ResourceLoader resourceLoader) {
this.resourceLoader = resourceLoader;
}
Set the template loader for this template. Set
when the Runtime determines where this template
came from the list of possible sources. |
public void setRuntimeServices(RuntimeServices rs) {
rsvc = rs;
}
|
public void touch() {
nextCheck = System.currentTimeMillis() + ( MILLIS_PER_SECOND * modificationCheckInterval);
}
'Touch' this template and thereby resetting
the nextCheck field. |