org.melati.template.velocity
Class WebMacroClasspathResourceLoader

java.lang.Object
  extended by org.apache.velocity.runtime.resource.loader.ResourceLoader
      extended by org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
          extended by org.melati.template.velocity.WebMacroClasspathResourceLoader

public class WebMacroClasspathResourceLoader
extends org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader

Loads templates from the classpath, mungs them if they are WM templates. Note that this does not allow modern WebMacro syntax with optionional #begin in #foreach.

Author:
Tim Pizey based on work by Jason van Zyl and Tim Joyce.

Field Summary
 
Fields inherited from class org.apache.velocity.runtime.resource.loader.ResourceLoader
className, isCachingOn, log, modificationCheckInterval, rsvc
 
Constructor Summary
WebMacroClasspathResourceLoader()
           
 
Method Summary
 java.io.InputStream getResourceStream(java.lang.String templateName)
          Get an InputStream so that the Runtime can build a template with it, munge it if it is a WM template.
 
Methods inherited from class org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
getLastModified, init, isSourceModified
 
Methods inherited from class org.apache.velocity.runtime.resource.loader.ResourceLoader
commonInit, getClassName, getModificationCheckInterval, isCachingOn, setCachingOn, setModificationCheckInterval
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebMacroClasspathResourceLoader

public WebMacroClasspathResourceLoader()
Method Detail

getResourceStream

public java.io.InputStream getResourceStream(java.lang.String templateName)
                                      throws org.apache.velocity.exception.ResourceNotFoundException
Get an InputStream so that the Runtime can build a template with it, munge it if it is a WM template.

Overrides:
getResourceStream in class org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
Parameters:
templateName - name of template to get
Returns:
InputStream containing the template
Throws:
org.apache.velocity.exception.ResourceNotFoundException - if template not found in the file template path.
See Also:
ResourceLoader


Copyright © 2000-2008 PanEris. All Rights Reserved.