org.argoprint.persistence.velocity
Class VelocityTemplateEngine

java.lang.Object
  extended by org.argoprint.persistence.velocity.VelocityTemplateEngine
All Implemented Interfaces:
TemplateEngine

public class VelocityTemplateEngine
extends java.lang.Object
implements TemplateEngine

This class is responsible for invoking the Velocity templating engine.

Author:
mfortner

Constructor Summary
VelocityTemplateEngine()
           
 
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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VelocityTemplateEngine

public VelocityTemplateEngine()
Method Detail

generate

public 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.

Specified by:
generate in interface TemplateEngine
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.

getTemplateExtensions

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

Specified by:
getTemplateExtensions in interface TemplateEngine
Returns:
an array of supported template extensions (i.e. xslt, vm). The extension should not include the period.

generate

public 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.

Specified by:
generate in interface TemplateEngine
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

public 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.

Specified by:
generate in interface TemplateEngine
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.