org.argoprint.persistence
Interface TemplateEngine

All Known Implementing Classes:
VelocityTemplateEngine, XSLTTemplateEngine

public interface TemplateEngine

This interface serves as an adapter for templating engines. Classes which implement this interface are expected to make calls to 3rd party templating engines. This provides a consistent programmatic interface for the use of templating engines in ArgoPrint.

Author:
mfortner

Method Summary
 void generate(org.argouml.kernel.Project project, java.io.File outputFile, java.io.File templateFile)
          This method takes the contents of a project and uses the templateFile to generate the content of the outputFile.
 void generate(org.argouml.kernel.Project project, java.io.OutputStream outputFile, java.io.InputStream templateFile)
          This method takes the contents of a project and uses the templateFile to generate the content of the outputFile.
 void generate(org.argouml.kernel.Project project, java.lang.String outputFile, java.lang.String templateFile)
          This method takes the contents of a project and uses the templateFile to generate the content of the outputFile.
 java.lang.String[] getTemplateExtensions()
          This method gets the template file extensions supported by this template engine.
 

Method Detail

getTemplateExtensions

java.lang.String[] getTemplateExtensions()
This method gets the template file extensions supported by this template engine.

Returns:
an array of supported template extensions (i.e. xslt, vm). The extension should not include the period.

generate

void generate(org.argouml.kernel.Project project,
              java.lang.String outputFile,
              java.lang.String templateFile)
              throws java.io.IOException,
                     TemplateEngineException
This method takes the contents of a project and uses the templateFile to generate the content of the outputFile.

Parameters:
project - The currently selected project
outputFile - The output file
templateFile - The template file
Throws:
java.io.IOException - if there is a problem generating the file.
TemplateEngineException - if any other exceptions are thrown by the underlying template engine.

generate

void generate(org.argouml.kernel.Project project,
              java.io.File outputFile,
              java.io.File templateFile)
              throws java.io.IOException,
                     TemplateEngineException
This method takes the contents of a project and uses the templateFile to generate the content of the outputFile.

Parameters:
project - The currently selected project
outputFile - The output file
templateFile - The template file
Throws:
java.io.IOException - if there is a problem generating the file.
TemplateEngineException - if any other exceptions are thrown by the underlying template engine.

generate

void generate(org.argouml.kernel.Project project,
              java.io.OutputStream outputFile,
              java.io.InputStream templateFile)
              throws java.io.IOException,
                     TemplateEngineException
This method takes the contents of a project and uses the templateFile to generate the content of the outputFile.

Parameters:
project - The currently selected project
outputFile - The output file
templateFile - The template file
Throws:
java.io.IOException - if there is a problem generating the file.
TemplateEngineException - if any other exceptions are thrown by the underlying template engine.