com.revusky.niggle.templates.freemarkerimpl
Class FreemarkerPageFactory

java.lang.Object
  |
  +--com.revusky.niggle.templates.freemarkerimpl.FreemarkerPageFactory
All Implemented Interfaces:
PageFactory

public class FreemarkerPageFactory
extends java.lang.Object
implements PageFactory

A concrete PageFactory type that vends Page objects that represent Freemarker templates.

Author:
Jonathan Revusky

Field Summary
protected  java.io.File defaultDirectory
           
protected  LocalizedFileTemplateCache templateCache
           
 
Constructor Summary
FreemarkerPageFactory()
           
 
Method Summary
 Page getPage(java.lang.String name, ServletInteraction interaction)
          Returns a Page.
 void setClassLoader(java.lang.ClassLoader cl)
          set the ClassLoader relative to which to look for page template files.
 void setDefaultPath(java.lang.String path)
          Sets the location from which pages based on files will be found.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

templateCache

protected LocalizedFileTemplateCache templateCache

defaultDirectory

protected java.io.File defaultDirectory
Constructor Detail

FreemarkerPageFactory

public FreemarkerPageFactory()
Method Detail

setDefaultPath

public void setDefaultPath(java.lang.String path)
Description copied from interface: PageFactory
Sets the location from which pages based on files will be found.
Specified by:
setDefaultPath in interface PageFactory
Following copied from interface: com.revusky.niggle.templates.PageFactory
Parameters:
the - location where we expect to find our templates. This could be relative to the ClassLoader if the path is not absolute.

getPage

public Page getPage(java.lang.String name,
                    ServletInteraction interaction)
             throws java.io.IOException
Description copied from interface: PageFactory
Returns a Page.
Specified by:
getPage in interface PageFactory
Following copied from interface: com.revusky.niggle.templates.PageFactory
Parameters:
name - a string that somehow identifies the page. May or may not be related to a file system name.
locale - the place for which the page is intended.
interaction - an object that provides some session context info This may be null in some implementations.
Returns:
a Page
Throws:
java.io.IOException - thrown if a necessary underlying resource is unavailable.

setClassLoader

public void setClassLoader(java.lang.ClassLoader cl)
Description copied from interface: PageFactory
set the ClassLoader relative to which to look for page template files.
Specified by:
setClassLoader in interface PageFactory