org.melati.template.velocity
Class WebMacroClasspathResourceLoader

Package class diagram package 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 This does not allow modern WebMacro syntax with optional #begin in #foreach. NOTE Only if a curly bracket is at the start of a line will it not be turned into an #end

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
 InputStream getResourceStream(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 InputStream getResourceStream(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-2010 PanEris. All Rights Reserved.