org.norther.tammi.spray.freemarker
Class DefaultTemplateLoader

java.lang.Object
  extended by org.norther.tammi.spray.freemarker.DefaultTemplateLoader
All Implemented Interfaces:
TemplateLoader, Serializable

public class DefaultTemplateLoader
extends Object
implements TemplateLoader, Serializable

A default implementation of Freemarker TemplateLoader.

Version:
$Id: DefaultTemplateLoader.java,v 1.8 2009/09/28 15:08:31 cvsimp Exp $
Author:
Ilkka Priha
See Also:
Serialized Form

Constructor Summary
DefaultTemplateLoader()
          Constructs a new template loader.
 
Method Summary
 void addResolver(ResourceResolver<?> rr)
          Adds a new resolver.
 void closeTemplateSource(Object source)
           
 Object findTemplateSource(String name)
           
 long getLastModified(Object source)
           
 Reader getReader(Object source, String encoding)
           
 boolean templateExists(String name)
          Checks whether the named template exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTemplateLoader

public DefaultTemplateLoader()
Constructs a new template loader.

Method Detail

addResolver

public void addResolver(ResourceResolver<?> rr)
Adds a new resolver.

Parameters:
rr - the resolver.

templateExists

public boolean templateExists(String name)
Checks whether the named template exists.

Parameters:
name - the name of the template.
Returns:
true if the template was found, otherwise false.

findTemplateSource

public Object findTemplateSource(String name)
                          throws IOException
Specified by:
findTemplateSource in interface TemplateLoader
Throws:
IOException

closeTemplateSource

public void closeTemplateSource(Object source)
Specified by:
closeTemplateSource in interface TemplateLoader

getLastModified

public long getLastModified(Object source)
Specified by:
getLastModified in interface TemplateLoader

getReader

public Reader getReader(Object source,
                        String encoding)
                 throws IOException
Specified by:
getReader in interface TemplateLoader
Throws:
IOException


Copyright © 2004 The Norther Organization. All rights reserved.