| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.velocity.runtime.resource.Resource
public abstract class Resource
This class represent a general text resource that may have been retrieved from any number of possible sources.
| Field Summary | |
|---|---|
| protected  Object | dataResource might require ancillary storage of some kind | 
| protected  String | encodingCharacter encoding of this resource | 
| protected  long | lastModifiedThe file modification time (in milliseconds) for the cached template. | 
| protected static long | MILLIS_PER_SECONDThe number of milliseconds in a minute, used to calculate the check interval. | 
| protected  long | modificationCheckIntervalHow often the file modification time is checked (in seconds). | 
| protected  String | nameName of the resource | 
| protected  long | nextCheckThe next time the file modification time will be checked (in milliseconds). | 
| protected  ResourceLoader | resourceLoaderThe template loader that initially loaded the input stream for this template, and knows how to check the source of the input stream for modification. | 
| protected  RuntimeServices | rsvc | 
| Constructor Summary | |
|---|---|
| Resource()Default constructor | |
| Method Summary | |
|---|---|
|  Object | getData()Get arbitrary data object that might be used by the resource. | 
|  String | getEncoding()get the encoding of this resource for example, "ISO-8859-1" | 
|  long | getLastModified()Return the lastModifed time of this resource. | 
|  String | getName()Get the name of this template. | 
|  ResourceLoader | getResourceLoader()Return the template loader that pulled in the template stream | 
|  boolean | isSourceModified() | 
| abstract  boolean | process()Perform any subsequent processing that might need to be done by a resource. | 
|  boolean | requiresChecking()Is it time to check to see if the resource source has been updated? | 
|  void | setData(Object data)Set arbitrary data object that might be used by the resource. | 
|  void | setEncoding(String encoding)set the encoding of this resource for example, "ISO-8859-1" | 
|  void | setLastModified(long lastModified)Set the last modified time for this resource. | 
|  void | setModificationCheckInterval(long modificationCheckInterval)Set the modification check interval. | 
|  void | setName(String name)Set the name of this resource, for example test.vm. | 
|  void | setResourceLoader(ResourceLoader resourceLoader)Set the template loader for this template. | 
|  void | setRuntimeServices(RuntimeServices rs) | 
|  void | touch()'Touch' this template and thereby resetting the nextCheck field. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected RuntimeServices rsvc
protected ResourceLoader resourceLoader
protected static final long MILLIS_PER_SECOND
protected long modificationCheckInterval
protected long lastModified
protected long nextCheck
protected String name
protected String encoding
protected Object data
| Constructor Detail | 
|---|
public Resource()
| Method Detail | 
|---|
public void setRuntimeServices(RuntimeServices rs)
rs - 
public abstract boolean process()
                         throws ResourceNotFoundException,
                                ParseErrorException,
                                Exception
Template or ContentResource, this
 indicates whether the resource could be read.
ResourceNotFoundException - Similar in semantics as
 returning false.
ParseErrorException
Exceptionpublic boolean isSourceModified()
public void setModificationCheckInterval(long modificationCheckInterval)
modificationCheckInterval - The interval (in seconds).public boolean requiresChecking()
public void touch()
public void setName(String name)
name - public String getName()
public void setEncoding(String encoding)
encoding - public String getEncoding()
public long getLastModified()
public void setLastModified(long lastModified)
lastModified - public ResourceLoader getResourceLoader()
public void setResourceLoader(ResourceLoader resourceLoader)
resourceLoader - public void setData(Object data)
data - public Object getData()
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||