Home » velocity-1.5 » org.apache » velocity » runtime » resource » loader » [javadoc | source]
abstract public class: ResourceLoader [javadoc | source]

Direct Known Subclasses:
    JarResourceLoader, WebappLoader, FileResourceLoader, StringResourceLoader, URLResourceLoader, DataSourceResourceLoader, ClasspathResourceLoader

This is abstract class the all text resource loaders should extend.
Field Summary
protected  boolean isCachingOn    Does this loader want templates produced with it cached in the Runtime. 
protected  long modificationCheckInterval    This property will be passed on to the templates that are created with this loader. 
protected  String className    Class name for this loader, for logging/debuggin purposes. 
protected  RuntimeServices rsvc     
protected  Log log     
Method from org.apache.velocity.runtime.resource.loader.ResourceLoader Summary:
commonInit,   getClassName,   getLastModified,   getModificationCheckInterval,   getResourceStream,   init,   isCachingOn,   isSourceModified,   setCachingOn,   setModificationCheckInterval
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.velocity.runtime.resource.loader.ResourceLoader Detail:
 public  void commonInit(RuntimeServices rs,
    ExtendedProperties configuration) 
    This initialization is used by all resource loaders and must be called to set up common properties shared by all resource loaders
 public String getClassName() 
    Return the class name of this resource Loader
 abstract public long getLastModified(Resource resource)
    Get the last modified time of the InputStream source that was used to create the template. We need the template here because we have to extract the name of the template in order to locate the InputStream source.
 public long getModificationCheckInterval() 
    Get the interval at which the InputStream source should be checked for modifications.
 abstract public InputStream getResourceStream(String source) throws ResourceNotFoundException
    Get the InputStream that the Runtime will parse to create a template.
 abstract public  void init(ExtendedProperties configuration)
    Initialize the template loader with a a resources class.
 public boolean isCachingOn() 
    The Runtime uses this to find out whether this template loader wants the Runtime to cache templates created with InputStreams provided by this loader.
 abstract public boolean isSourceModified(Resource resource)
    Given a template, check to see if the source of InputStream has been modified.
 public  void setCachingOn(boolean value) 
    Set the caching state. If true, then this loader would like the Runtime to cache templates that have been created with InputStreams provided by this loader.
 public  void setModificationCheckInterval(long modificationCheckInterval) 
    Set the interval at which the InputStream source should be checked for modifications.