toolbox.services.util
Interface TemplateService

Package class diagram package TemplateService
All Known Implementing Classes:
FreeMarkerTemplateServiceImpl

public interface TemplateService

Interface that defines a general purpose templating service interface.


Method Summary
 java.lang.String process(java.lang.String tmpl, java.util.Map data)
          Process the named template and return a String.
 void process(java.lang.String tmpl, java.util.Map data, java.io.OutputStream out)
          Process the named template and write the output to the given stream.
 

Method Detail

process

java.lang.String process(java.lang.String tmpl,
                         java.util.Map data)
                         throws ServiceException
Process the named template and return a String.

Parameters:
tmpl - String containing the template path.
data - Map instance containing the data to merge with the template.
Returns:
String containing the generated content.
Throws:
ServiceException - if the template cannot be processed.

process

void process(java.lang.String tmpl,
             java.util.Map data,
             java.io.OutputStream out)
             throws ServiceException
Process the named template and write the output to the given stream.

Parameters:
tmpl - String containing the template path.
data - Map instance containing the data to merge with the template.
out - OutputStream instance to write the output to.
Throws:
ServiceException - if the template cannot be processed.