org.jamon
Interface TemplateSource

All Known Implementing Classes:
FileTemplateSource, ResourceTemplateSource

public interface TemplateSource

An interface representing a "repository" of template sources. One obvious implementation would be a file-system based implementation (e.g. FileTemplateSource), but others might include storing templates in a database, or retrieving them remotely via HTTP.


Method Summary
 boolean available(String p_templatePath)
          Determines whether the indicated template source is available.
 String getExternalIdentifier(String p_templatePath)
          Get an identifying string for the specified template.
 InputStream getStreamFor(String p_templatePath)
          Get a InputStream for the source of the specified template.
 TemplateLocation getTemplateLocation(String p_templatePath)
           
 long lastModified(String p_templatePath)
          Determines when the indicated template was last modified, in ms since the epoch.
 void loadProperties(String p_path, Properties p_properties)
          Load any properties that might be used to influence the processing of templates within the specified directory.
 

Method Detail

lastModified

long lastModified(String p_templatePath)
                  throws IOException
Determines when the indicated template was last modified, in ms since the epoch.

Parameters:
p_templatePath - the path to the template
Returns:
the timestamp of when the template was last modified
Throws:
IOException

available

boolean available(String p_templatePath)
                  throws IOException
Determines whether the indicated template source is available.

Parameters:
p_templatePath - the path to the template
Returns:
whether the template source is available
Throws:
IOException

getStreamFor

InputStream getStreamFor(String p_templatePath)
                         throws IOException
Get a InputStream for the source of the specified template.

Parameters:
p_templatePath - the path to the template
Returns:
an InputStream for the data comprising the template
Throws:
IOException

getExternalIdentifier

String getExternalIdentifier(String p_templatePath)
Get an identifying string for the specified template.

Parameters:
p_templatePath - the path to the template
Returns:
an identifying string

getTemplateLocation

TemplateLocation getTemplateLocation(String p_templatePath)

loadProperties

void loadProperties(String p_path,
                    Properties p_properties)
                    throws IOException
Load any properties that might be used to influence the processing of templates within the specified directory.

Parameters:
p_path - The directory to to look for
p_properties - The Properties instance to add any found properties to.
Throws:
IOException